Skip to content

Commit 79392b8

Browse files
author
Sam Kleinman
committed
DOCS-1032: write concern related change
1 parent 95d7dbf commit 79392b8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

source/tutorial/enforce-unique-keys-for-sharded-collections.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ collections in a sharded environment, there are two options:
3737
collection and you can create multiple unique indexes. Otherwise
3838
you can shard on a single unique key.
3939

40-
Regardless of method, be aware that writes to the MongoDB database are
41-
"fire and forget," or "unsafe" by default: they will not return errors
42-
to the client if MongoDB rejects a write operation because of a
43-
duplicate key or other error. As a result if you want to enforce
44-
unique keys you **must** use the safe write setting in your
45-
driver. See your :doc:`driver's documentation </applications/drivers>` on
46-
:dbcommand:`getLastError` for more information.
40+
Always use the default :ref:`acknowledged <write-concern-acknowledged>`
41+
:ref:`write concern <write-concern>` in conjunction with a
42+
:doc:`recent MongoDB driver </release-notes/drivers-write-concern>`.
4743

4844
.. [#limitation] If you specify a unique index on a sharded
4945
collection, MongoDB will be able to enforce uniqueness only among

0 commit comments

Comments
 (0)