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

« back to all changes in this revision

Viewing changes to jstests/inc3.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.inc3;
 
3
 
 
4
t.drop();
 
5
t.save( { _id : 1 , z : 1 , a : 1 } );
 
6
t.update( {} , { $inc : { z : 1 , a : 1 } } );
 
7
t.update( {} , { $inc : { a : 1 , z : 1 } } );
 
8
assert.eq( { _id : 1 , z : 3 , a : 3 } , t.findOne() , "A" )
 
9
 
 
10
 
 
11
t.drop();
 
12
t.save( { _id : 1 , a : 1 , z : 1 } );
 
13
t.update( {} , { $inc : { z : 1 , a : 1 } } );
 
14
t.update( {} , { $inc : { a : 1 , z : 1 } } );
 
15
assert.eq( { _id : 1 , a : 3 , z : 3 } , t.findOne() , "B" )
 
16