[SERVER-6127] $project uasserts if an expected nested field has a non object parent in any source document Created: 19/Jun/12  Updated: 11/Jul/16  Resolved: 29/Jun/12

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

Type: Improvement Priority: Major - P3
Reporter: Aaron Staple Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

c = db.c;
c.drop();
 
c.save( { a:{ b:1 } } );
 
printjson( c.aggregate( { $project:{ ab:'$a.b' } } ) );
 
c.save( { a:1 } );
 
// Now asserts because a 'b' field cannot be found within 'a' in the new a:1 document.
printjson( c.aggregate( { $project:{ ab:'$a.b' } } ) );

Observed behavior: $project asserts if a field path references a non object parent.
Expected behavior: $project treats the field path as missing.



 Comments   
Comment by auto [ 29/Jun/12 ]

Author:

{u'date': u'2012-06-25T08:10:06-07:00', u'email': u'dannenberg.matt@gmail.com', u'name': u'Matt Dannenberg'}

Message: SERVER-6127 remove uassert from aggro pathparsing

$project returns undefined instead of an error when a nested document doesnt
exist along the specified path
corresponding test added
Branch: master
https://github.com/mongodb/mongo/commit/dda980dcfda0e05738686fe7fdad6e1e6a6466e3

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