Permalink
Browse files

SERVER-1040 add test

  • Loading branch information...
1 parent 0a00045 commit 4d7319d82fe11cf9b79b06e931ac68bf550576f5 @astaple astaple committed Aug 16, 2010
Showing with 16 additions and 0 deletions.
  1. +14 −0 jstests/update_arraymatch6.js
  2. +2 −0 mongo.xcodeproj/project.pbxproj
@@ -0,0 +1,14 @@
+t = db.jstests_update_arraymatch6;
+t.drop();
+
+function doTest() {
+ t.save( {a: [{id: 1, x: [5,6,7]}, {id: 2, x: [8,9,10]}]} );
+ t.update({'a.id': 1}, {$set: {'a.$.x': [1,1,1]}});
+ assert.automsg( "!db.getLastError()" );
+ assert.eq.automsg( "1", "t.findOne().a[ 0 ].x[ 0 ]" );
+}
+
+doTest();
+t.drop();
+t.ensureIndex( { 'a.id':1 } );
+doTest();
@@ -543,6 +543,7 @@
93BDCEB9115830CB0097FE87 /* repl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = repl.js; sourceTree = "<group>"; };
93BFA0E311330A8C0045D084 /* not2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = not2.js; sourceTree = "<group>"; };
93C38E940FA66622007D6E4A /* basictests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = basictests.cpp; sourceTree = "<group>"; };
+ 93C46E021219AB8E00382E61 /* update_arraymatch6.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = update_arraymatch6.js; sourceTree = "<group>"; };
93C529C511D047CF00CF42F7 /* repair2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = repair2.js; path = disk/repair2.js; sourceTree = "<group>"; };
93C5BC7911E5AE8700F9671C /* in6.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = in6.js; sourceTree = "<group>"; };
93C5BC9E11E5B7FE00F9671C /* group6.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = group6.js; sourceTree = "<group>"; };
@@ -833,6 +834,7 @@
934BEB9A10DFFA9600178102 /* jstests */ = {
isa = PBXGroup;
children = (
+ 93C46E021219AB8E00382E61 /* update_arraymatch6.js */,
93EC350F1207AEB000A95C8A /* remove9.js */,
93EC34601207628300A95C8A /* capped7.js */,
93E6E10A11FE2BBC00EDA451 /* capped6.js */,

0 comments on commit 4d7319d

Please sign in to comment.