diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
commit | 5d342a758c6095b4d30aba0750b54f13b8916f51 (patch) | |
tree | 762e9aa84781f5e3b96db2c02d356c29cf0217c0 /jstests/dbhash.js | |
parent | cbe2d992e9cd1ea66af9fa91df006106775d3073 (diff) | |
download | mongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz |
Imported Upstream version 2.0.0
Diffstat (limited to 'jstests/dbhash.js')
-rw-r--r-- | jstests/dbhash.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/jstests/dbhash.js b/jstests/dbhash.js index e9cbc94..7fea4b4 100644 --- a/jstests/dbhash.js +++ b/jstests/dbhash.js @@ -14,16 +14,22 @@ db.getCollectionNames().forEach( function( x ) { } } ); +function dbhash( mydb ) { + var ret = mydb.runCommand( "dbhash" ); + assert.commandWorked( ret, "dbhash failure" ); + return ret; +} + function gh( coll , mydb ){ if ( ! mydb ) mydb = db; - var x = mydb.runCommand( "dbhash" ).collections[coll.getName()]; + var x = dbhash( mydb ).collections[coll.getName()]; if ( ! x ) return ""; return x; } function dbh( mydb ){ - return mydb.runCommand( "dbhash" ).md5; + return dbhash( mydb ).md5; } assert.eq( gh( a ) , gh( b ) , "A1" ); |