Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6127

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0-rc0
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      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 Matt Dannenberg
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: