Files
mongo/jstests/core/dbhash2.js
2017-05-17 12:22:11 -04:00

18 lines
444 B
JavaScript

mydb = db.getSisterDB("config");
t = mydb.foo;
t.drop();
t.insert({x: 1});
res1 = mydb.runCommand("dbhash");
res2 = mydb.runCommand("dbhash");
assert.eq(res1.collections.foo, res2.collections.foo);
t.insert({x: 2});
res3 = mydb.runCommand("dbhash");
assert.neq(res1.collections.foo, res3.collections.foo);
// Validate dbHash with an empty database does not trigger an fassert/invariant
assert.commandFailed(db.runCommand({"dbhash": ""}));