开发者

mongodb and or combo

How do i do this in mo开发者_运维知识库ngodb....

(a || b || c) || (d && e)


(a || b || c) || (d && e) is equivalent to (a || b || c || (d && e))

if abcde are your fields and 12345 are the values (simple case you can put whatever as those expressions):

 db.foo.find( { $or : [ { a : 1 } , { b : 2 },{ c : 3 },{ d : 4 , e :5} ] } );

Note this is for mongodb >= 1.5.3 earlier ones do not have $or

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜