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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: 2.1.0
    • Component/s: Aggregation Framework
    • None
    • Environment:
      Mac OSX
    • OS X

      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.

            Assignee:
            cwestin Chris Westin
            Reporter:
            franktylerva Frank Tyler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: