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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.2.0-rc0
    • None
    • Aggregation Framework
    • None

    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.

      Attachments

        Activity

          People

            matt.dannenberg Matt Dannenberg
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: