mongodb多个$not查询
2019-10-11 本文已影响0人
GaJiCaptain
mongodb $not
如下:field_name字段中不包含hello,并且不包含word的
db.collection_name.find({"$and": [{ field_name:{$not:/.*hello.*/}},{field_name:{$not: /.*word.*/}}]})
如下:field_name字段中不包含hello,并且不包含word的
db.collection_name.find({"$and": [{ field_name:{$not:/.*hello.*/}},{field_name:{$not: /.*word.*/}}]})