summaryrefslogtreecommitdiff
path: root/jstests/core/copydb.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/copydb.js')
-rw-r--r--jstests/core/copydb.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/core/copydb.js b/jstests/core/copydb.js
new file mode 100644
index 00000000000..7c7c02542a4
--- /dev/null
+++ b/jstests/core/copydb.js
@@ -0,0 +1,20 @@
+
+
+
+
+a = db.getSisterDB( "copydb-test-a" );
+b = db.getSisterDB( "copydb-test-b" );
+
+a.dropDatabase();
+b.dropDatabase();
+
+a.foo.save( { a : 1 } );
+
+assert.eq( 1 , a.foo.count() , "A" );
+assert.eq( 0 , b.foo.count() , "B" );
+
+a.copyDatabase( a._name , b._name );
+
+assert.eq( 1 , a.foo.count() , "C" );
+assert.eq( 1 , b.foo.count() , "D" );
+