summaryrefslogtreecommitdiff
path: root/jstests/core/remove_justone.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/remove_justone.js')
-rw-r--r--jstests/core/remove_justone.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/core/remove_justone.js b/jstests/core/remove_justone.js
new file mode 100644
index 00000000000..e412a13483c
--- /dev/null
+++ b/jstests/core/remove_justone.js
@@ -0,0 +1,16 @@
+
+t = db.remove_justone
+t.drop()
+
+t.insert( { x : 1 } )
+t.insert( { x : 1 } )
+t.insert( { x : 1 } )
+t.insert( { x : 1 } )
+
+assert.eq( 4 , t.count() )
+
+t.remove( { x : 1 } , true )
+assert.eq( 3 , t.count() )
+
+t.remove( { x : 1 } )
+assert.eq( 0 , t.count() )