Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在执行此查询以查找 ID 为“345”且在其所有者数组中有一个字符串“jack”的书。
但它只查找所有者部分而不查询 id。我在做语法错误吗?
Book.findOne({owner:{$in:["jack"]} },{_id:"345"},function(err,data)
find 选择器的owner和_id属性都需要在同一个对象中:
owner
_id
Book.findOne({owner:{$in:["jack"]}, _id:"345"}, function(err,data) {...});