[DOCS-3967] Comment on: "manual/reference/operator/update/inc.txt" Created: 02/Sep/14  Updated: 16/Mar/15  Resolved: 10/Sep/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.11

Type: Improvement Priority: Blocker - P1
Reporter: Ian Bentley Assignee: Tim Slavin
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/master/reference/operator/update/inc/#up._S_inc
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0
Referrer: http://docs.mongodb.org/master/reference/operator/update/
Screen Resolution: 1920 x 1080
repo: docs
source: reference/operator/update/inc


Participants:
Days since reply: 9 years, 22 weeks, 6 days ago

 Description   

This page should probably mention what the behaviour of $inc is if the field doesn't exist. Also, no mention of how it works with findAndModify?



 Comments   
Comment by Githook User [ 11/Sep/14 ]

Author:

{u'username': u'TimSlavinMongoDB', u'name': u'Tim Slavin (MongoDB)', u'email': u'tim.slavin@10gen.com'}

Message: DOCS-3967: inc and missing field behavior

Signed-off-by: Sam Kleinman <samk@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/7e9f56ae5ef3c406679c27ee8ada38df0d3413ec

Comment by Scott Hernandez (Inactive) [ 08/Sep/14 ]

The second sentence of the first paragraph says:

{bq}
If the field does not exist, $inc adds the field and sets the field to the specified amount.{bq}

Not sure there is any value in mentioning findAndModify since it follow the rules of update, which is stated elsewhere – it is just an update that returns a document.

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