[DOCS-3038] Atomic characteristic of update $modifiers should be more explicit Created: 31/Mar/14  Updated: 16/Mar/15  Resolved: 10/Oct/14

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

Type: Improvement Priority: Major - P3
Reporter: Mathieu Poumeyrol Assignee: Andrew Aldridge
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 18 weeks, 5 days ago

 Description   

The fact $inc (and other) is atomic is difficult to establish from the current documentation. $inc reference page does not mention it.

Searching for "atomic" only returns a page with a findAndModify example.

15:28 < ragezor> hello guys, i'm trying to implement a counter system in mongodb and i need advice about implementation
15:28 < ragezor> i have a collection counters and in there a lot of documents which represent one counter each
15:29 < Nodex> so far so good
15:29 < ragezor> counters have field number which then i increment each time an event occurs
15:29 < ragezor> my question is
15:29 < ragezor> if many different processes are incrementing the counter
15:30 < kali> if you're using $inc:1, it will work as you want it to work
15:30 < ragezor> can it happen that counter breaks, that is some increments are not registered?
15:31 < ragezor> so $inc is atomic operation?
15:31 < kali> yes
15:31 < ragezor> ok, cool



 Comments   
Comment by Githook User [ 10/Oct/14 ]

Author:

{u'username': u'i80and', u'name': u'Andrew Aldridge', u'email': u'i80and@foxquill.com'}

Message: DOCS-3038: Clarify update atomicity.

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

Comment by Asya Kamsky [ 30/Apr/14 ]

I filed a related DOCS-3308 since that tutorial contributes to the misconception that $inc is not atomic.

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