~ubuntu-branches/ubuntu/trusty/mongodb/trusty-proposed

« back to all changes in this revision

Viewing changes to jstests/copydb.js

  • Committer: Bazaar Package Importer
  • Author(s): Antonin Kral
  • Date: 2010-01-29 19:48:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100129194845-8wbmkf626fwcavc9
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
 
 
4
 
 
5
a = db.getSisterDB( "copydb-test-a" );
 
6
b = db.getSisterDB( "copydb-test-b" );
 
7
 
 
8
a.dropDatabase();
 
9
b.dropDatabase();
 
10
 
 
11
a.foo.save( { a : 1 } );
 
12
 
 
13
assert.eq( 1 , a.foo.count() , "A" );
 
14
assert.eq( 0 , b.foo.count() , "B" );
 
15
 
 
16
a.copyDatabase( a._name , b._name );
 
17
 
 
18
assert.eq( 1 , a.foo.count() , "C" );
 
19
assert.eq( 1 , b.foo.count() , "D" );
 
20