0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

try to fix distinct

This commit is contained in:
Eliot Horowitz 2010-03-29 13:49:32 -04:00
parent 401bcd044c
commit 90d73f012a
2 changed files with 6 additions and 7 deletions

View File

@ -1505,14 +1505,13 @@ namespace mongo {
}
assert( size <= 0x7fffffff );
BSONObjBuilder b( (int) size );
int n=0;
BSONArrayBuilder b( result.subarrayStart( "values" ) );
for ( set<BSONElement,BSONElementCmpWithoutField>::iterator i = map.begin() ; i != map.end(); i++ ){
b.appendAs( *i , b.numStr( n++ ).c_str() );
b.append( *i );
}
result.appendArray( "values" , b.obj() );
b.done();
return true;
}

View File

@ -1662,7 +1662,7 @@ namespace mongo {
}
BSONArrayBuilder& append(const BSONElement& e){
_b.appendAs(e, num().c_str());
_b.appendAs(e, num());
return *this;
}