diff options
author | Aaron <aaron@10gen.com> | 2010-08-16 11:06:12 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2010-08-16 11:06:12 -0700 |
commit | 4d7319d82fe11cf9b79b06e931ac68bf550576f5 (patch) | |
tree | 339e6230159264a845c24cb0a09133b07c5ba466 | |
parent | 0a000453f303e204417d3b53ae4bece4a0a9e51e (diff) | |
download | mongo-4d7319d82fe11cf9b79b06e931ac68bf550576f5.tar.gz |
SERVER-1040 add test
-rw-r--r-- | jstests/update_arraymatch6.js | 14 | ||||
-rw-r--r-- | mongo.xcodeproj/project.pbxproj | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/jstests/update_arraymatch6.js b/jstests/update_arraymatch6.js new file mode 100644 index 00000000000..8892e6fcc68 --- /dev/null +++ b/jstests/update_arraymatch6.js @@ -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();
\ No newline at end of file diff --git a/mongo.xcodeproj/project.pbxproj b/mongo.xcodeproj/project.pbxproj index d1f8c398280..3d85cd941f5 100644 --- a/mongo.xcodeproj/project.pbxproj +++ b/mongo.xcodeproj/project.pbxproj @@ -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 */, |