Spaceface16518 / strat-collector

Combs through a specific subreddit for posts with over a certain threshold in comments. It then adds them to a database.
MIT License
2 stars 0 forks source link

Mongoose keeps querying admin #26

Closed Spaceface16518 closed 6 years ago

Spaceface16518 commented 6 years ago

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" }

As well as

  var Test = mongo.model("Test", schema, "Test");

But none of them seem to be working.

Spaceface16518 commented 6 years ago

mongo.ts was using the wrong driver version.