Find $in filter - works in shell but not work in NodeJS

This is my filter I successfully used this with shell. got three documents from the shell.

  resource_Target_Uuid: {
    '$in': [

However, it didn’t work in NodeJS - it gives nothing - any idea why it works differently?

FindCursor {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,

By the way, findOne is working…

console [Tue May 24 2022 16:43:15] [LOG]   {
  _id: new ObjectId("628d1ed357185223f9837572"),
  resource_Type: 'ND',
  resource_Group_Uuid: '0b73a502d4ba48339bd7605b46a79b43',
  resource_Name: 'new-node-c7g94',

found the solution… you should use find(query).toArray() instead of find(query)… in NodeJS. …

1 Like