Permalink
Browse files

group() now uses full key-names in output SERVER-296

Signed-off-by: Eliot <eliot@10gen.com>
  • Loading branch information...
1 parent 0ec495c commit 4a8c39140ba731efb5ca0bdb0c3521627b9f2469 @RedBeard0531 RedBeard0531 committed with erh Sep 16, 2009
Showing with 3 additions and 3 deletions.
  1. +1 −1 db/jsobj.cpp
  2. +2 −2 jstests/group1.js
View
@@ -939,7 +939,7 @@ namespace mongo {
break;
BSONElement x = getFieldDotted(e.fieldName());
if ( ! x.eoo() )
- b.append(x);
+ b.appendAs( x, e.fieldName() );
else if ( fillWithNull )
b.appendNull( e.fieldName() );
}
View
@@ -56,8 +56,8 @@ p = { key : { 'name.first' : true } ,
res = t.group( p );
assert.eq( 2 , res.length , "Z1" );
-assert.eq( "a" , res[0].first , "Z2" )
-assert.eq( "b" , res[1].first , "Z3" )
+assert.eq( "a" , res[0]['name.first'] , "Z2" )
+assert.eq( "b" , res[1]['name.first'] , "Z3" )
assert.eq( 2 , res[0].count , "Z4" )
assert.eq( 1 , res[1].count , "Z5" )

0 comments on commit 4a8c391

Please sign in to comment.