Permalink
Browse files

test for SERVER-206

  • Loading branch information...
1 parent 23ea3a4 commit a40772067168bd7a905a1b4f170e734d5bdd4a23 @erh erh committed Jan 15, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 jstests/set4.js
View
@@ -0,0 +1,15 @@
+
+t = db.set4;
+t.drop();
+
+orig = { _id:1 , a : [ { x : 1 } ]}
+t.insert( orig );
+
+t.update( {}, { $set : { 'a.0.x' : 2, 'foo.bar' : 3 } } );
+orig.a[0].x = 2; orig.foo = { bar : 3 }
+assert.eq( orig , t.findOne() , "A" );
+
+t.update( {}, { $set : { 'a.0.x' : 4, 'foo.bar' : 5 } } );
+orig.a[0].x = 4; orig.foo.bar = 5;
+assert.eq( orig , t.findOne() , "B" );
+

0 comments on commit a407720

Please sign in to comment.