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

« back to all changes in this revision

Viewing changes to jstests/count3.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
t = db.count3;
 
3
 
 
4
t.drop();
 
5
 
 
6
t.save( { a : 1 } );
 
7
t.save( { a : 1 , b : 2 } );
 
8
 
 
9
assert.eq( 2 , t.find( { a : 1 } ).itcount() , "A" );
 
10
assert.eq( 2 , t.find( { a : 1 } ).count() , "B" );
 
11
 
 
12
assert.eq( 2 , t.find( { a : 1 } , { b : 1 } ).itcount() , "C" );
 
13
assert.eq( 2 , t.find( { a : 1 } , { b : 1 } ).count() , "D" );
 
14
 
 
15
t.drop();
 
16
 
 
17
t.save( { a : 1 } );
 
18
 
 
19
assert.eq( 1 , t.find( { a : 1 } ).itcount() , "E" );
 
20
assert.eq( 1 , t.find( { a : 1 } ).count() , "F" );
 
21
 
 
22
assert.eq( 1 , t.find( { a : 1 } , { b : 1 } ).itcount() , "G" );
 
23
assert.eq( 1 , t.find( { a : 1 } , { b : 1 } ).count() , "H" );
 
24
 
 
25
 
 
26