[SERVER-12981] $or in $elemMatch works inconsistently on master Created: 01/Mar/14  Updated: 11/Jul/16  Resolved: 07/Mar/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc2

Type: Bug Priority: Major - P3
Reporter: David Glasser Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server12981.js    
Issue Links:
Related
is related to SERVER-11537 Incosistent behavior with $or and $el... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

On the 2014-01-02 nightly:

> db.x.find({x: {$elemMatch: {y: 12, $or:[{z: 1}, {z: 2}]}}})
> db.x.find({x: {$elemMatch: {$or:[{z: 1}, {z: 2}], y: 12}}})
error: {
	"$err" : "Can't canonicalize query: BadValue unknown operator: $or",
	"code" : 17287
}

Both work in 2.4.9. I would expect that either both of these queries would work or both would fail.



 Comments   
Comment by Githook User [ 07/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12981 handle $and/$nor/$or under $elemMatch
Branch: master
https://github.com/mongodb/mongo/commit/765409253203229a2c3577d1d8a3964f7a0d1554

Generated at Thu Feb 08 03:30:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.