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:
133
133
See the `GridFSUploadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSUploadOptions.html>`__
134
134
API Documentation for more information.
135
135
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
+
136
146
Upload a File Using an Input Stream
137
147
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
148
You can’t perform that action at this time.
0 commit comments