diff options
author | aaron <aaron@10gen.com> | 2013-03-15 03:17:01 -0700 |
---|---|---|
committer | aaron <aaron@10gen.com> | 2013-03-15 18:41:06 -0700 |
commit | e60c28a09c691a7c4d9447dab9347d15d85e5e39 (patch) | |
tree | 34d4bec2cb9571aede32d9da76df89ea229d6e0a /jstests/repl | |
parent | b3e4a86d28b0bec87358e9460183dbb1fab2d159 (diff) | |
download | mongo-e60c28a09c691a7c4d9447dab9347d15d85e5e39.tar.gz |
SERVER-4940 Update the repl16 test so it will trigger the appropriate behavior in the current mongo shell.
Diffstat (limited to 'jstests/repl')
-rw-r--r-- | jstests/repl/repl16.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/repl/repl16.js b/jstests/repl/repl16.js index 52f62bfc5dd..143bab60968 100644 --- a/jstests/repl/repl16.js +++ b/jstests/repl/repl16.js @@ -7,7 +7,7 @@ function doTest( insert ) { rt = new ReplTest( "repl16tests" ); master = rt.start( true ); - master.getDB( 'd' ).createCollection( 'c', { capped:true, size:5*1024 } ); + master.getDB( 'd' ).createCollection( 'c', { capped:true, size:5*1024, autoIndexId:false } ); mc = master.getDB( 'd' )[ 'c' ]; insert( {a:1} ); @@ -36,7 +36,9 @@ function insertWithIds( obj ) { } function insertWithoutIds( obj ) { - mc._mongo.insert( mc._fullName, obj ); + // Insert 'obj' via an upsert operation with a match expression that cannot match any documents. + // The insert operation is avoided because the mongo shell adds an _id on insert. + mc.update( { $where:'false' }, obj, true ); } doTest( insertWithIds ); |