0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/datasize2.js

28 lines
441 B
JavaScript
Raw Normal View History

2010-04-28 19:20:26 +02:00
t = db.datasize2
t.drop();
N = 1000
for ( i=0; i<N; i++ ){
t.insert( { _id : i , s : "asdasdasdasdasdasdasd" } );
}
c = { dataSize : "test.datasize2" ,
"keyPattern" : {
"_id" : 1
},
"min" : {
"_id" : 0
},
"max" : {
"_id" : N
}
};
assert.eq( N , db.runCommand( c ).numObjects , "A" )
c.maxObjects = 100;
assert.eq( 101 , db.runCommand( c ).numObjects , "B" )