[SERVER-27088] Revert changes to positional projections and positional updates in 3.4 Created: 17/Nov/16  Updated: 19/Nov/16  Resolved: 17/Nov/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.4.0-rc4, 3.5.1

Type: Task Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-14662 Positional projection queries (and po... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 2016-11-21
Participants:

 Description   

SERVER-14662 changed positional projections and positional updates to error if multiple arrays were encountered when matching the filter. This change had undesirable effects. Users were no longer able to issue the following positional projections and positional updates:

> db.c.insert({a: [1, 2], b: [3, 4]})
> db.c.find({a: 1, b: 4}, {"a.$": 1})

> db.c.insert({a: [1, 2], b: [3, 4]})
> db.c.update({a: 1, b: 4}, {$set: {"a.$": 5}})

We will no longer error in these cases.



 Comments   
Comment by Tess Avitabile (Inactive) [ 17/Nov/16 ]

Reverted in:
https://github.com/mongodb/mongo/commit/d9c598ac6d5f79cde4d5439eb21f773b025e917f

https://github.com/mongodb/mongo/commit/5c3f83de911a2d7a512954349925b3c6056b886e

Comment by NOVALUE Mitar [ 17/Nov/16 ]

I think this is exactly what I described in: https://jira.mongodb.org/browse/SERVER-14662?focusedCommentId=879086&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-879086

I think semantics and a way to resolve this issues I described there is what you want to implement. That would cover also the edge case you discovered above. Making it as strict as you made it in 3.4 is simply not useful.

Comment by Daniel Pasette (Inactive) [ 17/Nov/16 ]

Can you detail the undesirable effects a little?

Generated at Thu Feb 08 04:14:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.