$project uasserts if an expected nested field has a non object parent in any source document

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.0-rc0
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Matt Dannenberg (Inactive)
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: