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

« back to all changes in this revision

Viewing changes to jstests/update2.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
f = db.ed_db_update2;
 
2
 
 
3
f.drop();
 
4
f.save( { a: 4 } );
 
5
f.update( { a: 4 }, { $inc: { a: 2 } } );
 
6
assert.eq( 6, f.findOne().a );
 
7
 
 
8
f.drop();
 
9
f.save( { a: 4 } );
 
10
f.ensureIndex( { a: 1 } );
 
11
f.update( { a: 4 }, { $inc: { a: 2 } } );
 
12
assert.eq( 6, f.findOne().a );
 
13
 
 
14
// Verify that drop clears the index
 
15
f.drop();
 
16
f.save( { a: 4 } );
 
17
f.update( { a: 4 }, { $inc: { a: 2 } } );
 
18
assert.eq( 6, f.findOne().a );