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

Aggregation Framework $project Crashes Server when _Id is Removed in Prior $project

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.1
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Environment:
      Mac OSX
    • Operating System:
      OS X

      Description

      Assuming the following data:

      {
      title : "this is my title" ,
      author : "bob" ,
      posted : new Date() ,
      pageViews : 5 ,
      tags : [ "fun" , "good" , "fun" ] ,
      comments : [

      { author :"joe" , text : "this is cool" }

      ,

      { author :"sam" , text : "this is bad" }

      ],
      other :

      { foo : 5 }


      }

      db.article.aggregate({ $project : { author : 1}}) ---- This runs fine

      db.article.aggregate({ $project : { author : 1, _id : 0}}) ---- This also runs fine

      db.article.aggregate({ $project : { author : 1, _id : 0}}, { $project :{"Writer" : "$author"}}) ---- This crashes the server.

      After further investigation, it seems when I exclude the _id field in the last $project, things work as expected.

      db.article.aggregate({ $project : { author : 1}}, { $project :{"Writer" : "$author", _id : 0}}) ---- This works as expected.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: