Skip to content

DOCS-3038: Clarify update atomicity. #2032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/core/write-operations-introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ determine which documents to update as well as an options document that
affects its behavior, such as the ``multi`` option to update multiple
documents.

Operations performed by an update are atomic within a single document. For
example, you can safely use the :update:`$inc` and :update:`$mul` operators to
modify frequently-changed fields in concurrent applications.

The following diagram highlights the components of a MongoDB update
operation:

Expand Down
2 changes: 2 additions & 0 deletions source/reference/operator/update/inc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ the field to the specified value.
Use of the :update:`$inc` operator on a field with a null value will
generate an error.

:update:`$inc` is an atomic operation within a single document.

Example
-------

Expand Down
2 changes: 2 additions & 0 deletions source/reference/operator/update/mul.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Multiplication with values of mixed numeric types (32-bit integer,
:ref:`Multiplication Type Conversion Rules
<faq-developers-multiplication-type-conversion>` for details.

:update:`$mul` is an atomic operation within a single document.

Examples
--------

Expand Down