summaryrefslogtreecommitdiff
path: root/jstests/js2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/js2.js')
-rw-r--r--jstests/js2.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/js2.js b/jstests/js2.js
new file mode 100644
index 00000000000..53ad58c428c
--- /dev/null
+++ b/jstests/js2.js
@@ -0,0 +1,22 @@
+
+t = db.jni2;
+t.remove( {} );
+
+db.jni2t.remove( {} );
+
+assert.eq( 0 , db.jni2t.find().length() , "A" );
+
+t.save( { z : 1 } );
+t.save( { z : 2 } );
+assert.throws( function(){
+ t.find( { $where :
+ function(){
+ db.jni2t.save( { y : 1 } );
+ return 1;
+ }
+ } ).forEach( printjson );
+} , null , "can't save from $where" );
+
+assert.eq( 0 , db.jni2t.find().length() , "B" )
+
+assert(t.validate().valid , "E");