diff options
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" ); |