diff --git a/source/fundamentals/gridfs.txt b/source/fundamentals/gridfs.txt index 3977029e7..bc57a2d0c 100644 --- a/source/fundamentals/gridfs.txt +++ b/source/fundamentals/gridfs.txt @@ -133,6 +133,16 @@ following code snippet: See the `GridFSUploadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSUploadOptions.html>`__ API Documentation for more information. +.. important:: Use a ``MAJORITY`` Write Concern + + When storing files in a GridFS bucket, ensure that you use the ``WriteConcern.MAJORITY`` + write concern. If you specify a different write concern, replica set elections that occur + during a GridFS file upload might interrupt the upload process and cause some file chunks + to be lost. + + For more information about write concerns, see the :manual:`Write Concern ` + page in the Server manual. + Upload a File Using an Input Stream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~