-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query 10 (02/22/16)
-
(copied to CRM)
Running the following commands on 2.6 and 2.4 gives different output when running following commands:
db.createCollection("PositionalOperatorRepro") db.PositionalOperatorRepro.insert({"_id": "test1", "Items": [ { "Id": 1 }, { "Id": 2 } ] }) db.PositionalOperatorRepro.find({ "_id" : "test1", "Items" : { "$exists" : true, "$elemMatch" : { "Id" : 2 } } } , { "Items.$" : 1 })
// 2.4 returns {.. Items: [{Id:2}]} // 2.6 returns {.. Items: [{Id:1}]} // 2.6 without $exists {.. Items: [{Id:2}]}
If we remove the "$exists" : true criteria the output will be the same.
Is this change documented anywhere? There could be compatibility issues when upgrading.
I'm attaching a screen shot where I reproduced this behavior.
- is duplicated by
-
SERVER-17159 $ Positional Operator Only Updating First Sub-Document
- Closed
-
SERVER-1013 positional $ operator field mismatch
- Closed
-
SERVER-11537 Incosistent behavior with $or and $elemMatch
- Closed
-
SERVER-14837 Positional Operator matching wrong nested document
- Closed
-
SERVER-16409 Updates against paths composed with array index notation and positional operator can insert an embedded document
- Closed
-
SERVER-17999 Regression between MongoDB 2.4 and 2.6
- Closed
-
SERVER-41382 Update in nested array based on Date queries may not work properly
- Closed
- is related to
-
SERVER-16888 $ positional operator with $elemMatch doesn't work when multiple update critera supplied
- Closed
-
SERVER-11537 Incosistent behavior with $or and $elemMatch
- Closed
-
SERVER-21794 Array field limitation in query document [Only one array field may appear in the query document.]
- Closed
-
SERVER-18500 Resolve ambiguity of positional projections with multiple implicit array traversal predicates in certain cases
- Backlog
- related to
-
SERVER-27088 Revert changes to positional projections and positional updates in 3.4
- Closed