summaryrefslogtreecommitdiff
path: root/jstests/dbhash2.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-10-03 11:25:00 -0400
committerEliot Horowitz <eliot@10gen.com>2013-10-03 11:25:42 -0400
commit5b74302fb716ed3ee812a008d4341a3c4355299d (patch)
treec9356e1d2968ffc737c861202133c08e8d6da0c7 /jstests/dbhash2.js
parent1660c6c78eae0fc21a4b7fb51444a677ecc51d54 (diff)
downloadmongo-5b74302fb716ed3ee812a008d4341a3c4355299d.tar.gz
SERVER-11021: cache dbhash results in mongod for config. collections
Diffstat (limited to 'jstests/dbhash2.js')
-rw-r--r--jstests/dbhash2.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/dbhash2.js b/jstests/dbhash2.js
new file mode 100644
index 00000000000..ac491291c2b
--- /dev/null
+++ b/jstests/dbhash2.js
@@ -0,0 +1,22 @@
+
+mydb = db.getSisterDB( "config" );
+
+t = mydb.foo;
+t.drop();
+
+t.insert( { x : 1 } );
+res1 = mydb.runCommand( "dbhash" );
+assert( res1.fromCache.indexOf( "config.foo" ) == -1 );
+
+res2 = mydb.runCommand( "dbhash" );
+assert( res2.fromCache.indexOf( "config.foo" ) >= 0 );
+assert.eq( res1.collections.foo, res2.collections.foo );
+
+t.insert( { x : 2 } );
+res3 = mydb.runCommand( "dbhash" );
+assert( res3.fromCache.indexOf( "config.foo" ) < 0 );
+assert.neq( res1.collections.foo, res3.collections.foo );
+
+
+
+