From 5d342a758c6095b4d30aba0750b54f13b8916f51 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Wed, 14 Sep 2011 17:08:06 +0200 Subject: Imported Upstream version 2.0.0 --- jstests/capped9.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 jstests/capped9.js (limited to 'jstests/capped9.js') diff --git a/jstests/capped9.js b/jstests/capped9.js new file mode 100644 index 0000000..9ea506c --- /dev/null +++ b/jstests/capped9.js @@ -0,0 +1,28 @@ + +t = db.capped9; +t.drop(); + +db.createCollection("capped9" , {capped:true, size:1024*50 }); + +t.insert( { _id : 1 , x : 2 , y : 3 } ) + +assert.eq( 1 , t.find( { x : 2 } ).itcount() , "A1" ) +assert.eq( 1 , t.find( { y : 3 } ).itcount() , "A2" ) +//assert.throws( function(){ t.find( { _id : 1 } ).itcount(); } , [] , "A3" ); // SERVER-3064 + +t.update( { _id : 1 } , { $set : { y : 4 } } ) +//assert( db.getLastError() , "B1" ); // SERVER-3064 +//assert.eq( 3 , t.findOne().y , "B2" ); // SERVER-3064 + +t.ensureIndex( { _id : 1 } ) + +assert.eq( 1 , t.find( { _id : 1 } ).itcount() , "D1" ) + +t.update( { _id : 1 } , { $set : { y : 4 } } ) +assert( null == db.getLastError() , "D1: " + tojson( db.getLastError() ) ) +assert.eq( 4 , t.findOne().y , "D2" ) + + + + + -- cgit v1.2.3