File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,16 @@ following code snippet:
133133See the `GridFSUploadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSUploadOptions.html>`__
134134API 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+
136146Upload a File Using an Input Stream
137147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138148
You can’t perform that action at this time.
0 commit comments