OR queries in 1.5.3

23 views
Skip to first unread message

Alan B

unread,
Jun 13, 2010, 4:43:18 PM6/13/10
to mongodb-user
Hi all, I see that version 1.5.3 will have support for OR queries.
Will they be able to handle a query like this:

{user_id: { $in : [1,3,5] }, role: 'admin' } OR {user_id: { $in :
[2,4,6] }, role: 'manager' }

thanks, Alan

Eliot Horowitz

unread,
Jun 13, 2010, 4:48:42 PM6/13/10
to mongod...@googlegroups.com
Yes - it should.
You can try it out in the 1.5 nightly.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Flavien C

unread,
Jun 14, 2010, 8:01:58 AM6/14/10
to mongodb-user
Can you have "And" inside of the $or operator (disjunctive form),
like:

{ $or : [ { "a": 2, "b": 4 } , { "a": 3, "b": 5 } ] }

And given the syntax of the operator, I assume the conjuntive form is
not possible, is that correct?
> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.- Hide quoted text -
>
> - Show quoted text -

Dwight Merriman

unread,
Jun 14, 2010, 8:54:53 AM6/14/10
to mongod...@googlegroups.com
i believe that is correct - for now

we'll add more of that later just trying to get the basics there now

Kristina Chodorow

unread,
Jun 14, 2010, 9:02:46 AM6/14/10
to mongod...@googlegroups.com
Yes.

On Mon, Jun 14, 2010 at 8:01 AM, Flavien C <flavien...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages