[SERVER-6177] verify assertion when parent of an inclusion field is an operator expression Created: 22/Jun/12  Updated: 11/Jul/16  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: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

ExpressionObject::includePath expects that an existing expression encountered while traversing the supplied field path is an ExpressionObject. But this will not be the case if an earlier expression on the field was a non object expression (it could be an operator expression).

Current behavior: verify assertion in the case described above, and in the test
Expected behavior: uassert?

c = db.c;
c.drop();
 
c.save( {} );
 
printjson( c.aggregate( { $project:{ 'x':{ $add:[ 1 ] }, 'x.b':1 } } ) );



 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:10:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.