0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00
mongodb/jstests/jni1.js
2009-01-31 17:22:22 -05:00

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);