summaryrefslogtreecommitdiff
path: root/jstests/core/remove3.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/remove3.js')
-rw-r--r--jstests/core/remove3.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/core/remove3.js b/jstests/core/remove3.js
new file mode 100644
index 00000000000..2a51a6e0fd4
--- /dev/null
+++ b/jstests/core/remove3.js
@@ -0,0 +1,18 @@
+
+t = db.remove3;
+t.drop();
+
+for ( i=1; i<=8; i++){
+ t.save( { _id : i , x : i } );
+}
+
+assert.eq( 8 , t.count() , "A" );
+
+t.remove( { x : { $lt : 5 } } );
+assert.eq( 4 , t.count() , "B" );
+
+t.remove( { _id : 5 } );
+assert.eq( 3 , t.count() , "C" );
+
+t.remove( { _id : { $lt : 8 } } );
+assert.eq( 1 , t.count() , "D" );