[SERVER-5012] Aggregation Framework $project Crashes Server when _Id is Removed in Prior $project Created: 18/Feb/12  Updated: 11/Jul/16  Resolved: 22/Feb/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 2.1.0
Fix Version/s: 2.1.1

Type: Bug Priority: Major - P3
Reporter: Frank Tyler Assignee: Chris Westin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OSX


Attachments: Text File server.txt    
Issue Links:
Duplicate
is duplicated by SERVER-5252 server fails on some request Closed
Operating System: OS X
Participants:

 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.



 Comments   
Comment by auto [ 22/Feb/12 ]

Author:

{u'login': u'cwestin', u'name': u'U-tellus\\cwestin', u'email': u'cwestin@10gen.com'}

Message: SERVER-5012
Branch: master
https://github.com/mongodb/mongo/commit/b2cce77619151cf1fb2d5da56a2f4f8fb5511481

Comment by Frank Tyler [ 18/Feb/12 ]

Server Trace

Generated at Thu Feb 08 03:07:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.