summaryrefslogtreecommitdiff
path: root/jstests/pull_remove1.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/pull_remove1.js')
-rw-r--r--jstests/pull_remove1.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/pull_remove1.js b/jstests/pull_remove1.js
new file mode 100644
index 00000000000..379f3f2832b
--- /dev/null
+++ b/jstests/pull_remove1.js
@@ -0,0 +1,14 @@
+
+t = db.pull_remove1
+t.drop()
+
+o = { _id : 1 , a : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] }
+t.insert( o )
+
+assert.eq( o , t.findOne() , "A1" )
+
+o.a = o.a.filter( function(z){ return z >= 6; } )
+t.update( {} , { $pull : { a : { $lt : 6 } } } )
+
+assert.eq( o.a , t.findOne().a , "A2" )
+