Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Basic issue is that the matcher records a single array position in match details without any context. There is no validation that the field path of the matched array matches the field path leading to the positional operator.
> db.f.drop()
|
true
|
> db.f.save( { a: [ 1, 2, 3 ], b: [ 4, 5, 6 ] } )
|
> db.f.update( { a:1,b:6 }, {$set:{'a.$':10}} )
|
> db.f.findOne()
|
{
|
"_id" : ObjectId("4bc4c770e4db696f077b91d8"),
|
"a" : [
|
1,
|
2,
|
10
|
],
|
"b" : [
|
4,
|
5,
|
6
|
]
|
Attachments
Issue Links
- duplicates
-
SERVER-14662 Positional projection queries (and positional update ops) should fail with error if multiple arrays encountered
-
- Closed
-
- is duplicated by
-
SERVER-6614 When matching multiple items in inner collections / document arrays, selecting with { 'innerCollection.$' : 1 } only returns the lastest of the matched element.
-
- Closed
-
-
SERVER-14770 warn when more than one array is used in a query with $ projection operator
-
- Closed
-
- is related to
-
SERVER-828 Support for selecting array elements in return specifier (projection)
-
- Closed
-