mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
disintct and eoo fix
This commit is contained in:
parent
3eb4295ae9
commit
be1b3de4ca
@ -1431,6 +1431,8 @@ namespace mongo {
|
||||
while ( cursor->more() ){
|
||||
BSONObj o = cursor->next();
|
||||
BSONObj value = o.extractFields( keyPattern );
|
||||
if ( value.isEmpty() )
|
||||
continue;
|
||||
if ( map.insert( value ).second ){
|
||||
size += o.objsize() + 20;
|
||||
uassert( "distinct too big, 4mb cap" , size < 4 * 1024 * 1024 );
|
||||
|
@ -4,3 +4,10 @@ t.drop();
|
||||
|
||||
t.save({a:null});
|
||||
assert.eq( 0 , t.distinct('a.b').length , "A" );
|
||||
|
||||
t.drop();
|
||||
t.save( { a : 1 } );
|
||||
assert.eq( [1] , t.distinct( "a" ) , "B" );
|
||||
t.save( {} )
|
||||
assert.eq( [1] , t.distinct( "a" ) , "C" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user