mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
debugging
This commit is contained in:
parent
1ffe115475
commit
82b0f9daef
@ -144,24 +144,24 @@ assert.eq( 6 , countCursor( db.foo.find().limit(1)._exec() ) , "getMore 3" );
|
||||
|
||||
// update
|
||||
person = db.foo.findOne( { num : 3 } );
|
||||
assert.eq( "bob" , person.name );
|
||||
assert.eq( "bob" , person.name , "update setup 1" );
|
||||
person.name = "bob is gone";
|
||||
db.foo.update( { num : 3 } , person );
|
||||
person = db.foo.findOne( { num : 3 } );
|
||||
assert.eq( "bob is gone" , person.name );
|
||||
assert.eq( "bob is gone" , person.name , "update test B" );
|
||||
|
||||
// remove
|
||||
assert( db.foo.findOne( { num : 3 } ) != null );
|
||||
assert( db.foo.findOne( { num : 3 } ) != null , "remove test A" );
|
||||
db.foo.remove( { num : 3 } );
|
||||
assert( db.foo.findOne( { num : 3 } ) == null );
|
||||
assert( db.foo.findOne( { num : 3 } ) == null , "remove test B" );
|
||||
|
||||
db.foo.save( { num : 3 , name : "eliot2" } );
|
||||
person = db.foo.findOne( { num : 3 } );
|
||||
assert( person );
|
||||
assert( person.name == "eliot2" );
|
||||
assert( person , "remove test C" );
|
||||
assert.eq( person.name , "eliot2" );
|
||||
|
||||
db.foo.remove( { _id : person._id } );
|
||||
assert( db.foo.findOne( { num : 3 } ) == null );
|
||||
assert( db.foo.findOne( { num : 3 } ) == null , "remove test E - should have been null - not: " + tojson( db.foo.findOne( { num : 3 } ) ) );
|
||||
|
||||
placeCheck( 8 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user