Mongodb $where query always true with nodejs

后端 未结 7 1979
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 11:01

When I query my database with a function passed in the \"$where\" clause in nodejs, it always return me all documents in the db.

For example, if I do



        
相关标签:
7条回答
  • 2021-01-12 11:37

    The context will always be that of the mongo database, since the function is executed there. There is no way to share the context between the two instances. You have to rethink the way you query and come up with a different strategy.

    0 讨论(0)
提交回复
热议问题