The query statement is as follows:
db.collection.find({
subject:{
$in:[
Eval("/ test 1/ig "),
Eval("/ test 2/ig ")
]
}
})
Executing on the shell side can search outsubject
The field containsTest 1
OrTest 2
Document for
But in js code (node.js
+mongoose
) can’t find out the results, why is this?
Js code is as follows:
Varcondition = {subject: {$ in: [eval ('/test 1/ig'),eval('/ test 2/ig')]}};
collection.find(condition, function(err, docs){
//to do something ...
});
If you paste your collection name and Schema, it is probably the definition of schema.