Skip to content

Commit 1333b11

Browse files
committed
DOCSP-4079: GridFS write concern (#547)
* DOCSP-4079: GridFS write concern * fix * format * tech review (cherry picked from commit 911e639)
1 parent 8cb0ded commit 1333b11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/fundamentals/gridfs.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ following code snippet:
133133
See the `GridFSUploadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSUploadOptions.html>`__
134134
API Documentation for more information.
135135

136+
.. important:: Use a ``MAJORITY`` Write Concern
137+
138+
When storing files in a GridFS bucket, ensure that you use the ``WriteConcern.MAJORITY``
139+
write concern. If you specify a different write concern, replica set elections that occur
140+
during a GridFS file upload might interrupt the upload process and cause some file chunks
141+
to be lost.
142+
143+
For more information about write concerns, see the :manual:`Write Concern </reference/write-concern/>`
144+
page in the Server manual.
145+
136146
Upload a File Using an Input Stream
137147
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138148

0 commit comments

Comments
 (0)