[DOCS-13322] Investigate changes in SERVER-6527: in projection implementation, dotted field inclusion supersedes parent field inclusion Created: 02/Jan/20  Updated: 13/Nov/23  Resolved: 06/Feb/20

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.3.2, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jeffrey Allen
Resolution: Fixed Votes: 0
Labels: docs-grab-bag, docs-query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-6527 in projection implementation, dotted ... Closed
Related
Participants:
Days since reply: 4 years, 6 days ago
Epic Link: DOCS: 4.4 Server Release Work

 Description   

Description

Downstream Change Summary

In 4.2 find projection, it is possible to specify two paths which “collide." For example:
db.c.find({},

Unknown macro: {"a.b"}

) produces {"a" : { "b" : 1, "c" : 1 }}

In 4.4, these projections are considered illegal.

Description of Linked Ticket

Observed behavior: In the query projection implementation, the projection

{ a:1, 'a.b':1 }

is equivalent to

{ 'a.b':1 }

not

{ a:1 }

(at least in some cases).
Expected behavior: The projection

{ a:1, 'a.b':1 }

is equivalent to

{ a:1 }

.

Test:

> c.save( { a:[ 1, { b:2 }, { c:3 } ] } )
> c.find( {}, { a:1 } )
{ "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ 1, { "b" : 2 }, { "c" : 3 } ] }
> c.find( {}, { 'a.b':1 } )
{ "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ { "b" : 2 }, { } ] }
> c.find( {}, { a:1, 'a.b':1 } )
{ "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ { "b" : 2 }, { } ] }

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 06/Feb/20 ]

Author:

{'name': 'jeff-allen-mongo', 'username': 'jeff-allen-mongo', 'email': 'jeffrey.allen@10gen.com'}

Message: (DOCS-13322): Clarify projection behavior for specifying embedded and parent fields
Branch: master
https://github.com/mongodb/docs/commit/41641a95c5b885a166208aa6042eacf6b7575646

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