[SERVER-205] $or Created: 30/Jul/09  Updated: 12/Jul/16  Resolved: 09/Jun/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 1.5.3

Type: New Feature Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: Aaron Staple
Resolution: Done Votes: 44
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-109 $or should use indexes Closed
is depended on by SERVER-109 $or should use indexes Closed
Participants:

 Description   

maybe: { $or : [

{ x : 5 }

,

{ a : 3 }

] }



 Comments   
Comment by auto [ 13/Apr/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-205 cleaner test
http://github.com/mongodb/mongo/commit/41d65a81f9e0b04e80ee435c81d909c7c4b6fe98

Comment by Eliot Horowitz (Inactive) [ 13/Apr/10 ]

ah, i see
i think we have to disallow it
unless we do some very smart logic about ensuring its the same path

Comment by Aaron Staple [ 13/Apr/10 ]

so if somebody does an update and they want to use the $ operator to represent the modified field - which of the $or clauses should we use to get the array match from? What if there's an array match in a non or portion of the query?

Comment by Eliot Horowitz (Inactive) [ 13/Apr/10 ]

did you mean to have something after the $ or am i missing something

Comment by Aaron Staple [ 13/Apr/10 ]

what's desired behavior for the $ operator?

Comment by Eliot Horowitz (Inactive) [ 13/Apr/10 ]

Recursive shouldn't be allowed

Comment by Aaron Staple [ 13/Apr/10 ]

so allowing non or fields adjacent to or fields invites the possibility of recursive ors. Do we want to allow recursive ors?

Comment by Eliot Horowitz (Inactive) [ 12/Apr/10 ]

you can $not an $or

ideally { a:1,$or:[

{b:2}

,

{c:3}

]} is supported

though
$or : [

{ a : 1 , b : 2 }

,

{ a : 2 , b : 3 }

]
isn't so bad if that's a lot easier.

maybe start with that actually

Comment by Aaron Staple [ 12/Apr/10 ]

Also, can you $not an $or?

Comment by Aaron Staple [ 12/Apr/10 ]

is a query like this allowed { a:1,$or:[

{b:2}

,

{c:3}

]} or will the $or always be the only top level field?

Comment by Dwight Merriman [ 26/Mar/10 ]

see also http://www.mongodb.org/display/DOCS/OR+operations+in+query+expressions

Comment by Randy Pond [ 26/Aug/09 ]

Some discussion on the forum about $or:
http://groups.google.com/group/mongodb-user/browse_thread/thread/1323d06daa2ac49a/201775d882cbb49b?lnk=gst&q=or#201775d882cbb49b

Generated at Thu Feb 08 02:53:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.