summaryrefslogtreecommitdiff
path: root/jstests/update_arraymatch4.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-04-27 00:24:12 -0400
committerEliot Horowitz <eliot@10gen.com>2010-04-27 00:24:12 -0400
commit3cbdcddd136c3c92986c4393210364273529a129 (patch)
tree7bcc3636f88394f7a7383e97b13e7e8e658d1521 /jstests/update_arraymatch4.js
parent0d21a119d228fa04b237665a0df503fd334b8f42 (diff)
downloadmongo-3cbdcddd136c3c92986c4393210364273529a129.tar.gz
test for SERVER-1055
Diffstat (limited to 'jstests/update_arraymatch4.js')
-rw-r--r--jstests/update_arraymatch4.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/update_arraymatch4.js b/jstests/update_arraymatch4.js
new file mode 100644
index 00000000000..88ca45b360f
--- /dev/null
+++ b/jstests/update_arraymatch4.js
@@ -0,0 +1,18 @@
+
+t = db.update_arraymatch4
+t.drop()
+
+x = { _id : 1 , cast : ["John","Hugh","Halle"] , movie:"Swordfish" }
+t.insert( x )
+assert.eq( x , t.findOne() , "A1" )
+
+x.cast[0] = "John Travolta"
+t.update( { cast : "John" } , { $set : { "cast.$" : "John Travolta" } } )
+assert.eq( x , t.findOne() , "A2" )
+
+t.ensureIndex( { cast : 1 } )
+x.cast[0] = "xxx"
+t.update( { cast : "John Travolta" } , { $set : { "cast.$" : "xxx" } } )
+//assert.eq( x , t.findOne() , "A3" ); // SERVER-1055
+
+