0
db.testcond.aggregate([{$match:{$eq:["color", "red"]}}])
db.testcond.aggregate([{$match:{"color":"red"}}])
使用$eq
运营商查询返回结果为空(尽管有文件与color:"red"
)。
没有$eq
运算符的另一个查询返回正确的结果。
不应该两个查询都返回相同的结果吗?
db.testcond.aggregate([{$match:{$eq:["color", "red"]}}])
db.testcond.aggregate([{$match:{"color":"red"}}])
使用$eq
运营商查询返回结果为空(尽管有文件与color:"red"
)。
没有$eq
运算符的另一个查询返回正确的结果。
不应该两个查询都返回相同的结果吗?
$eq回报真如果参数是相等的,假否则。它不会返回匹配的文档作为第二个查询。