2009-01-27 05:28:26 +01:00
|
|
|
|
|
|
|
t = db.jni2;
|
|
|
|
t.remove( {} );
|
|
|
|
|
|
|
|
db.jni2t.remove( {} );
|
|
|
|
|
2009-12-03 23:41:45 +01:00
|
|
|
assert.eq( 0 , db.jni2t.find().length() , "A" );
|
2009-01-27 05:28:26 +01:00
|
|
|
|
|
|
|
t.save( { z : 1 } );
|
|
|
|
t.save( { z : 2 } );
|
2009-12-03 23:41:45 +01:00
|
|
|
assert.throws( function(){
|
|
|
|
t.find( { $where :
|
2009-01-27 05:28:26 +01:00
|
|
|
function(){
|
|
|
|
db.jni2t.save( { y : 1 } );
|
|
|
|
return 1;
|
|
|
|
}
|
2009-12-03 23:41:45 +01:00
|
|
|
} ).length();
|
|
|
|
} , "can't save from $where" );
|
2009-01-27 05:28:26 +01:00
|
|
|
|
2009-12-03 23:41:45 +01:00
|
|
|
assert.eq( 0 , db.jni2t.find().length() , "B" )
|
2009-01-27 05:28:26 +01:00
|
|
|
|
2009-12-03 23:41:45 +01:00
|
|
|
assert(t.validate().valid , "E");
|