0

I am trying to use collection.aggregate in NodeJS and is coming back with a blank error.

This is what I have so far, which works in terminal directly with MongoDB

const something = await Collection.aggregate([{ '$match': { 'clientId': 80 }}]);

res.send(something)

I have tried this in the past and it did work and nothing has changed (my code file is probably 5 lines at this point)

Geo
  • 3,160
  • 6
  • 41
  • 82
  • Again what is the type of the `clientId` in your schema? Could you show some sample documents as well – Ashh Apr 04 '19 at 02:28
  • @AnthonyWinzlet The type is Int. I can't share any docs at the moment – Geo Apr 04 '19 at 05:44
  • Probably you are checking the wrong database. – Ashh Apr 04 '19 at 05:52
  • @AnthonyWinzlet nope I am 100% on that :) Node js comes back with an empty error so something goes wrong here... – Geo Apr 04 '19 at 07:58

0 Answers0