0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/jni1.js
2009-01-26 23:28:26 -05:00

13 lines
312 B
JavaScript

db = connect( "foo" );
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);