Home:ALL Converter>how to use nin and regex in mongoDB

how to use nin and regex in mongoDB

Ask Time:2013-11-28T06:27:49         Author:user3024505

Json Formatter

How to use nin and regex in mongoDB?

I want to find document using nin and regex

but nin does not work!

Query:

{ "$and" : [ 

{ "id" : { "$nin" : [ "529653cb5bc5b0e42d339bd3" , "529653cb5bc5b0e498339bd3"]}} ,

{ "content" : { "$regex" : "(?i)apple" , "$options" : "i"} }

] }

Should I using mongo subquery?

Author:user3024505,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20254286/how-to-use-nin-and-regex-in-mongodb
yy