Files
mongo/jstests/core/id1.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

17 lines
617 B
JavaScript

t = db.id1
t.drop();
t.save( { _id : { a : 1 , b : 2 } , x : "a" } );
t.save( { _id : { a : 1 , b : 2 } , x : "b" } );
t.save( { _id : { a : 3 , b : 2 } , x : "c" } );
t.save( { _id : { a : 4 , b : 2 } , x : "d" } );
t.save( { _id : { a : 4 , b : 2 } , x : "e" } );
t.save( { _id : { a : 2 , b : 2 } , x : "f" } );
assert.eq( 4 , t.find().count() , "A" );
assert.eq( "b" , t.findOne( { _id : { a : 1 , b : 2 } } ).x );
assert.eq( "c" , t.findOne( { _id : { a : 3 , b : 2 } } ).x );
assert.eq( "e" , t.findOne( { _id : { a : 4 , b : 2 } } ).x );
assert.eq( "f" , t.findOne( { _id : { a : 2 , b : 2 } } ).x );