[DOCS-505] v2.2 shell has an improved update() API Created: 09/Sep/12  Updated: 26/Sep/12  Resolved: 18/Sep/12

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Richard Kreuter (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 11 years, 21 weeks ago

 Description   

In the v2.2 shell, update()'s third argument can be a document, in which case the fields in the document specify whether to do upsert or multi. These should be doc'd here:

http://docs.mongodb.org/manual/reference/method/db.collection.update/

Examples:

// Do an upsert.
db.foo.update( {name:"Smith"}, {$set:{age:30}}, {upsert:true})
// Do a multi-update
db.foo.update( {age:{$lt:30}}, {$inc:{salary:10000}}, {multi:true});

This new API is considerably easier to present to people and slightly less error prone than the pre-v2.2 optional-positional-boolean interface.



 Comments   
Comment by auto [ 26/Sep/12 ]

Author:

{u'date': u'2012-09-26T07:36:24-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: minor: DOCS-505 style edit
Branch: master
https://github.com/mongodb/docs/commit/6758f0c3149766452049788778e298a6c819956b

Comment by auto [ 26/Sep/12 ]

Author:

{u'date': u'2012-09-26T07:34:51-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: merge DOCS-505
Branch: master
https://github.com/mongodb/docs/commit/24d2d9839b70c59d4069fc7dbfc5b7ee1ccb3122

Comment by auto [ 26/Sep/12 ]

Author:

{u'date': u'2012-09-20T14:03:57-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}

Message: DOCS-505 spelling fix and move example closer to associated sentence
Branch: master
https://github.com/mongodb/docs/commit/9fbdcf3979272f55dffad7212c20171e1d43fdd0

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-19T10:28:46-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}

Message: DOCS-505 update api change
Branch: master
https://github.com/mongodb/docs/commit/71ec9f0aac1116925bbb95fef672826ce134bdad

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-18T18:29:18-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-505 edits for consistency and style
Branch: master
https://github.com/mongodb/docs/commit/4357ae406eb3408f957993b1e2f4aedda09d9258

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-18T18:04:24-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: merge: DOCS-505
Branch: master
https://github.com/mongodb/docs/commit/9c862ac9c50610cbd12e01892d27dc44528d7551

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-18T12:05:43-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}

Message: DOCS-505 v2.2 has improved update() api
Branch: master
https://github.com/mongodb/docs/commit/885d51a085b34e99959a26be401b29082c513f62

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-18T11:26:31-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}

Message: DOCS-505 update() method has new api
Branch: master
https://github.com/mongodb/docs/commit/931e4b9ef6fc132f89debdc0e06f5bb4dc5672f4

Comment by auto [ 19/Sep/12 ]

Author:

{u'date': u'2012-09-18T10:26:38-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}

Message: DOCS-505 v2.2 has new update() API
Branch: master
https://github.com/mongodb/docs/commit/cf5094bfd5cb9eb2c290443fbc03aa3de78399f5

Generated at Thu Feb 08 07:38:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.