mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
13 lines
290 B
JavaScript
13 lines
290 B
JavaScript
|
|
|
|
t = db.jni1;
|
|
t.remove( {} );
|
|
|
|
t.save( { z : 1 } );
|
|
t.save( { z : 2 } );
|
|
assert( 2 == t.find().length() );
|
|
assert( 2 == t.find( { $where : function(){ return 1; } } ).length() );
|
|
assert( 1 == t.find( { $where : function(){ return obj.z == 2; } } ).length() );
|
|
|
|
assert(t.validate().valid);
|