Skip to content

Commit

Permalink
don't connect explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Jan 31, 2009
1 parent 09bbd0e commit b675332
Show file tree
Hide file tree
Showing 50 changed files with 6 additions and 56 deletions.
1 change: 0 additions & 1 deletion jstests/apitest_db.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dd = function( x ){

dd( "a" );

db = connect( "test" )

dd( "b" );

Expand Down
1 change: 0 additions & 1 deletion jstests/apitest_dbcollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests for the db collection
*/

db = connect( "test" )


/*
Expand Down
1 change: 0 additions & 1 deletion jstests/auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" )

users = db.getCollection( "system.users" );
users.remove( {} );
Expand Down
1 change: 0 additions & 1 deletion jstests/basic1.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.getCollection( "basic1" );
assert( t.drop() );

Expand Down
1 change: 0 additions & 1 deletion jstests/basic2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.getCollection( "basic2" );
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/basic3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.getCollection( "foo" );

t.find( { "a.b" : 1 } ).toArray();
Expand Down
1 change: 0 additions & 1 deletion jstests/basic4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.getCollection( "basic4" );
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/basic5.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.getCollection( "basic5" );
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/basic6.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.basic6;

t.findOne();
Expand Down
1 change: 0 additions & 1 deletion jstests/basic7.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" )
t = db.basic7;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/capped.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db=connect("test");
db.capped.drop();
db.createCollection("cptest", {capped:true, size:30000});
t = db.cptest;
Expand Down
1 change: 0 additions & 1 deletion jstests/capped2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db=connect("test");
db.capped2.drop();
db._dbCommand( { create: "capped2", capped: true, size: 1000, $nExtents: 11 } );
t = db.capped2;
Expand Down
1 change: 0 additions & 1 deletion jstests/cursor2.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ function testCursorCountVsArrLen(dbConn) {
}


db = connect("test")
testCursorCountVsArrLen(db);
1 change: 0 additions & 1 deletion jstests/cursor3.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ function testConstrainedFindWithOrdering( db ) {
checkResults( [ 1, 0 ], r.find( { a: { $lte: 1 } } ).sort( { a: -1 } ) );
}

db = connect( "test" );
testConstrainedFindWithOrdering( db );
1 change: 0 additions & 1 deletion jstests/cursor4.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ function testConstrainedFindMultiFieldSorting( db ) {
checkResults( reverseEntries.slice( 1, 4 ), r.find( { a: { $lt: 2 }, b: { $gt: 0 } } ).sort( { a: -1, b: -1 } ) );
}

db = connect( "test" );
testConstrainedFindMultiFieldSorting( db );
1 change: 0 additions & 1 deletion jstests/cursor5.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ function testBoundsWithSubobjectIndexes( db ) {
checkResults( [ z[ 3 ], z[ 1 ] ], r.find( { e: { $gt: 4 }, "a.b": 1 } ).sort( rIdx ) );
}

db = connect( "test" );
testBoundsWithSubobjectIndexes( db );
1 change: 0 additions & 1 deletion jstests/cursor6.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function check( indexed ) {
eq( z[ 0 ], f[ 3 ] );
}

db = connect( "test" );
db.setProfilingLevel( 1 );
r = db.ed_db_cursor6;
r.drop();
Expand Down
1 change: 0 additions & 1 deletion jstests/cursor7.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ function testMultipleInequalities( db ) {
checkResults( [ z[ 2 ], z[ 1 ] ], r.find( { a: { $gte: 1, $lte: 7, $gt: 2, $lt: 6 }, b: { $gte: 2, $lte: 8, $gt: 3, $lt: 7 } } ).sort( rIdx ) );
}

db = connect( "test" );
testMultipleInequalities( db );
1 change: 0 additions & 1 deletion jstests/error1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );

// test 1
db.$cmd.findOne({reseterror:1});
Expand Down
1 change: 0 additions & 1 deletion jstests/find1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.find1;
t.drop();

Expand Down
3 changes: 1 addition & 2 deletions jstests/find2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ function testObjectIdFind( db ) {
assert( f[ 1 ]._id < f[ 2 ]._id );
}

db = connect( "test" );
testObjectIdFind( db );
testObjectIdFind( db );
1 change: 0 additions & 1 deletion jstests/find3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.find3;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/index1.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.embeddedIndexTest;

t.remove( {} );
Expand Down
3 changes: 1 addition & 2 deletions jstests/index2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* test indexing where the key is an embedded object.
*/

db = connect( "test" );
t = db.embeddedIndexTest2;

t.drop();
Expand Down Expand Up @@ -38,4 +37,4 @@ assert( t.find({z:{a:18}}).length() == 1 );
assert( t.find().sort( { z : 1 } ).length() == 4 );
assert( t.find().sort( { z : -1 } ).length() == 4 );

assert(t.validate().valid);
assert(t.validate().valid);
1 change: 0 additions & 1 deletion jstests/index3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "foo");

t = db.index3;
t.dropIndexes();
Expand Down
1 change: 0 additions & 1 deletion jstests/index4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// index4.js

//db = connect( "test" );

t = db.index4;
t.drop();
Expand Down
1 change: 0 additions & 1 deletion jstests/index5.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function validate() {
assert.eq( 1, r[ 1 ].a );
}

db = connect( "test" );
t = db.index5;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/index6.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// index6.js Test indexes on array subelements.

db = connect( "test" );
r = db.ed.db.index5;
r.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/index7.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function both( k, q ) {
end( k, q );
}

db = connect( "test" );
f = db.ed_db_index7;
f.drop();

Expand Down
3 changes: 1 addition & 2 deletions jstests/index_check1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect("ed_db_index_check1");

db.somecollection.drop();

Expand All @@ -24,4 +23,4 @@ db.somecollection.ensureIndex({a:1});

assert(db.system.namespaces.find({name:/somecollection/}).length() == 2);

assert(db.somecollection.validate().valid);
assert(db.somecollection.validate().valid);
3 changes: 1 addition & 2 deletions jstests/jni1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@


db = connect( "foo" );
t = db.jni1;
t.remove( {} );

Expand All @@ -10,4 +9,4 @@ assert( 2 == t.find().length() );
assert( 2 == t.find( { $where : function(){ return 1; } } ).length() );
assert( 1 == t.find( { $where : function(){ return obj.z == 2; } } ).length() );

assert(t.validate().valid);
assert(t.validate().valid);
1 change: 0 additions & 1 deletion jstests/jni2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "foo" );
t = db.jni2;
t.remove( {} );

Expand Down
1 change: 0 additions & 1 deletion jstests/jni3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "foo");
t = db.jni3;

for( z = 0; z < 2; z++ ) {
Expand Down
1 change: 0 additions & 1 deletion jstests/jni4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.jni4;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/jni7.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.jni7;
t.drop();

Expand Down
3 changes: 1 addition & 2 deletions jstests/jni8.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.jni8;
t.drop();

Expand All @@ -10,4 +9,4 @@ assert.eq( 1 , t.find( function(){ return this.b[0] == 2; } ).length() );
assert.eq( 0 , t.find( function(){ return this.b[0] == 3; } ).length() );
assert.eq( 1 , t.find( function(){ return this.b[1] == 3; } ).length() );

assert(t.validate().valid);
assert(t.validate().valid);
1 change: 0 additions & 1 deletion jstests/jni9.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
c = db.jni9;
c.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/objid1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.objid1;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/objid2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.objid2;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/objid3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.objid3;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/remove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// remove.js
// unit test for db remove

db = connect( "test" );
t = db.removetest;

function f(n,dir) {
Expand Down
1 change: 0 additions & 1 deletion jstests/remove2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// remove2.js
// a unit test for db remove

db = connect( "test" );
t = db.removetest2;

function f() {
Expand Down
1 change: 0 additions & 1 deletion jstests/remove4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
t = db.remove4;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/sort1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// test sorting, mainly a test ver simple with no index

db = connect( "test" );
t = db.sorrrt;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/sort2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// test sorting, mainly a test ver simple with no index

db = connect( "test" );
t = db.sorrrt2;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/sort3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.sort3;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/sort_numeric.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

db = connect( "test" );
t = db.sort_numeric;
t.drop();

Expand Down
1 change: 0 additions & 1 deletion jstests/uniqueness.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//db=connect("192.168.58.1/test", u , p);

t = db.foo;

Expand Down
1 change: 0 additions & 1 deletion jstests/update.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect("ed_db_update");


asdf = db.getCollection( "asdf" );
Expand Down
3 changes: 1 addition & 2 deletions jstests/update2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
db = connect( "test" );
f = db.ed_db_update2;

f.drop();
Expand All @@ -16,4 +15,4 @@ assert.eq( 4, f.findOne().a );
f.drop();
f.save( { a: 4 } );
f.update( { a: 4 }, { $inc: { a: 2 } } );
assert.eq( 6, f.findOne().a );
assert.eq( 6, f.findOne().a );

0 comments on commit b675332

Please sign in to comment.