String() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) { stringstream ss; ss << i; client_->insert( ns_.c_str(), BSON( "a" << ss.str() ) ); } }
TenIndex() : ns_( testNs( this ) ) { const char *names = "aaaaaaaaa"; for( int i = 0; i < 9; ++i ) { client_->resetIndexCache(); client_->ensureIndex( ns_.c_str(), BSON( "_id" << 1 ), false, names + i ); } }
ObjectId() : ns_( testNs( this ) ) { OID id; for( int i = 0; i < 100000; ++i ) { id.init(); client_->insert( ns_.c_str(), BSON( "a" << id ) ); } }
Query() : ns_( testNs( this ) ) { const char *names = "aaaaaaaaaa"; for( int i = 0; i < 10; ++i ) { client_->resetIndexCache(); client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i ); } lk_.reset( new Lock::GlobalWrite ); }
NoMatchLong() : ns_( testNs( this ) ) { const char *names = "aaaaaaaaaa"; for( int i = 0; i < 100000; ++i ) { BSONObjBuilder b; for( int j = 0; j < 10; ++j ) b << ( names + j ) << i; client_->insert( ns_.c_str(), b.obj() ); } }
Hint() : ns_( testNs( this ) ) { const char *names = "aaaaaaaaa"; for( int i = 0; i < 9; ++i ) { client_->resetIndexCache(); client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i ); } _lk.reset( new Lock::GlobalWrite ); _ctx.reset( new Client::Context( ns_ ) ); hint_ = BSON( "hint" << BSON( "a" << 1 ) ); }
Hint() : ns_( testNs( this ) ) { const char *names = "aaaaaaaaa"; for( int i = 0; i < 9; ++i ) { client_->resetIndexCache(); client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i ); } lk_.reset( new dblock ); Client::Context ctx( ns_ ); hint_ = BSON( "hint" << BSON( "a" << 1 ) ); }
Object() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) { client_->insert( ns_.c_str(), BSON( "a" << BSON( "a" << i ) ) ); } }
Count() : ns_( testNs( this ) ) { BSONObj obj = BSON( "a" << 1 ); for( int i = 0; i < 100000; ++i ) client_->insert( ns_, obj ); }
CountSimpleIndex() : ns_( testNs( this ) ) { BSONObj obj = BSON( "a" << "b" ); for( int i = 0; i < 100000; ++i ) client_->insert( ns_, obj ); client_->ensureIndex( ns_, obj ); }
GetMoreIndex() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) client_->insert( ns_.c_str(), BSON( "a" << i ) ); client_->ensureIndex( ns_, BSON( "a" << 1 ) ); c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 ).hint( BSON( "a" << 1 ) ) ); }
GetMoreKeyMatchHelps() : ns_( testNs( this ) ) { for( int i = 0; i < 1000000; ++i ) client_->insert( ns_.c_str(), BSON( "a" << i << "b" << i % 10 << "c" << "d" ) ); client_->ensureIndex( ns_, BSON( "a" << 1 << "b" << 1 ) ); c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 << "b" << 0 ).hint( BSON( "a" << 1 << "b" << 1 ) ) ); }
SortReverse() : ns_( testNs( this ) ) { for( int i = 0; i < 50000; ++i ) client_->insert( ns_.c_str(), BSON( "_id" << ( 50000 - 1 - i ) ) ); }
GetMore() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) client_->insert( ns_.c_str(), BSON( "a" << i ) ); c_ = client_->query( ns_.c_str(), Query() ); }
Capped() : ns_( testNs( this ) ) { client_->createCollection( ns_.c_str(), 100000, true ); }
SortOrdered() : ns_( testNs( this ) ) { for( int i = 0; i < 50000; ++i ) client_->insert( ns_.c_str(), BSON( "_id" << i ) ); }
TwoIndex() : ns_( testNs( this ) ) { client_->ensureIndex( ns_, BSON( "_id" << 1 ), "my_id" ); }
OneIndexReverse() : ns_( testNs( this ) ) { client_->ensureIndex( ns_, BSON( "_id" << 1 ) ); }
OneIndexHighLow() : ns_( testNs( this ) ) { client_->ensureIndex( ns_, BSON( "_id" << 1 ) ); }
Smaller() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) client_->insert( ns_.c_str(), BSON( "_id" << i << "b" << 2 ) ); }
SetGrow() : ns_( testNs( this ) ) { for( int i = 0; i < 10000; ++i ) client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << "" ) ); }
void run() { string ns = testNs( this ); for( int i = 0; i < 100000; ++i ) { client_->insert( ns.c_str(), BSON( "_id" << i ) ); } }
NoMatchIndex() : ns_( testNs( this ) ) { for( int i = 0; i < 100000; ++i ) client_->insert( ns_.c_str(), BSON( "_id" << i ) ); }