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
精彩评论