MongoDB has sets of documents called collections. The app is supposed to query the Test collection to retreve the test posts. Instead it is querying admin.
There are several problems with this. First off, querying the admin collection is not allowed, it is purely for system admin activity and maintainence, not storing data. Second, that is not the right database. Duh.
I've tried a couple of soultions:
let schema = new mongo.Schema(
{
title: String,
author: { name: String },
body: String,
upvotes: Number,
downvotes: Number,
gilded: Boolean,
netUps: Number
},
{ collection: "Test" }
MongoDB has sets of documents called collections. The app is supposed to query the
Test
collection to retreve the test posts. Instead it is querying admin.There are several problems with this. First off, querying the admin collection is not allowed, it is purely for system admin activity and maintainence, not storing data. Second, that is not the right database. Duh.
I've tried a couple of soultions:
As well as
But none of them seem to be working.