MongoDB查询布尔值的语法是什么?
键MongoDB查询布尔值的语法是什么?,mongodb,Mongodb,键的值为TRUE或空白 我有以下疑问: db.users.find( { $not: {is_agent:TRUE} }, {email:1} ) 我得到以下错误: ReferenceError: TRUE is not defined "$err" : "Can't canonicalize query: BadValue unknown top level operator: $not", "code" : 17287 当我使
的值为TRUE或空白
我有以下疑问:
db.users.find( { $not: {is_agent:TRUE} }, {email:1} )
我得到以下错误:
ReferenceError: TRUE is not defined
"$err" : "Can't canonicalize query: BadValue unknown top level operator: $not",
"code" : 17287
当我使用“TRUE”
时,我得到了以下错误:
ReferenceError: TRUE is not defined
"$err" : "Can't canonicalize query: BadValue unknown top level operator: $not",
"code" : 17287
正确的语法是什么
$eq
匹配等于指定值的值
$ne
匹配所有不等于指定值的值
例如:
db.users.find({is_agent: {$ne: true}})
或