-
Type:
Question
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.4.6
-
Component/s: Querying
-
None
-
Environment:RHEL 6.1
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
My understanding is that the default behavior when querying is for an implicit AND between fields being queried. But in the case of a query with multiple $or clauses the effect is for the clauses to be merged into one $or statement. So a query like:
{ $or : [
,
{ event : "e2" }], $or [
{ host : "h1" },
{ host : "h2" }] }
I would have expected results containing only events e1 or e2 that are hosted by h1 or h2. But the actual results are document with events e1 or e2 or host h1 or h2. Is this the expected behavior or should the query hold true to the implicit AND between fields?
NOTE: I can get the results I want by nesting the $or clauses within an $and.