[SERVER-6468] Treat nested and dotted projections the same Created: 16/Jul/12  Updated: 28/Oct/15  Resolved: 20/Jul/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.2.0-rc1

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

All four of these $projections should do the same thing:

{'a.b': 1} // classic inclusion
{a: {b: 1} // nested inclusion
{'a.b': '$a.b'} // dotted FieldPathExpression
{a: {b: '$a.b'} // nested FieldPathExpression



 Comments   
Comment by auto [ 20/Jul/12 ]

Author:

{u'date': u'2012-07-14T12:04:12-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: Rewrite ExpressionObject

The main difference between this version and the old is that the following
three $pipelines will produce the same output (SERVER-6468):

{'a.b': 1}

// classic inclusion
{a:

{b: 1}

// nested inclusion

{'a.b': '$a.b'}

// dotted FieldPathExpression
{a:

{b: '$a.b'}

// nested FieldPathExpression

Additionally support for exclusion of fields other than _id has been
removed for 2.2 (SERVER-6361)

Other related bugs:
SERVER-6177 better error for

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

SERVER-6181 support for computed _id
SERVER-6184 support {'a.b': 1, a:{c:1}} in either order

Remaining TODOs:
Re-enable the isSimple() method
See if this can be used more directly by $group to support nested fields (SERVER-6198)

Disabled test for SERVER-5369 because it depends on ability to exclude
arbitrary fields.
Branch: master
https://github.com/mongodb/mongo/commit/ec18db98680d31b120350ad45d5f74095125e9a5

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