summaryrefslogtreecommitdiff
path: root/jstests/remove_justone.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-08-22 00:52:06 -0400
committerEliot Horowitz <eliot@10gen.com>2010-08-22 00:52:06 -0400
commitfa8b9a8c734c673c62c447bfb1db8a497f2fa5d8 (patch)
tree07c3eb30db8ca5809d67b8dddd57205ec1308ad7 /jstests/remove_justone.js
parent6b9d67d4afc3ced5e9a55b57c9c4c66698d48d0f (diff)
downloadmongo-fa8b9a8c734c673c62c447bfb1db8a497f2fa5d8.tar.gz
shell support for justOne for removes SERVER-1653
Diffstat (limited to 'jstests/remove_justone.js')
-rw-r--r--jstests/remove_justone.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/remove_justone.js b/jstests/remove_justone.js
new file mode 100644
index 00000000000..e412a13483c
--- /dev/null
+++ b/jstests/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() )