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

« back to all changes in this revision

Viewing changes to jstests/in.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.in1;
 
3
t.drop();
 
4
 
 
5
t.save( { a : 1 } );
 
6
t.save( { a : 2 } );
 
7
 
 
8
assert.eq( 1 , t.find( { a : { $in : [ 1 ] } } ).itcount() , "A" );
 
9
assert.eq( 1 , t.find( { a : { $in : [ 2 ] } } ).itcount() , "B" );
 
10
assert.eq( 2 , t.find( { a : { $in : [ 1 , 2 ] } } ).itcount() , "C" );
 
11
 
 
12
t.ensureIndex( { a : 1 } );
 
13
 
 
14
assert.eq( 1 , t.find( { a : { $in : [ 1 ] } } ).itcount(), "D" );
 
15
assert.eq( 1 , t.find( { a : { $in : [ 2 ] } } ).itcount() , "E" );
 
16
assert.eq( 2 , t.find( { a : { $in : [ 1 , 2 ] } } ).itcount() , "F" );
 
17
 
 
18
assert.eq( 0 , t.find( { a : { $in : [] } } ).itcount() , "G" );
 
19