Skip to content

Commit

Permalink
DOCSP-4079: GridFS write concern (#547)
Browse files Browse the repository at this point in the history
* DOCSP-4079: GridFS write concern

* fix

* format

* tech review

(cherry picked from commit 911e639)
  • Loading branch information
norareidy committed Jun 6, 2024
1 parent a7fa88b commit b97b1e8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/fundamentals/gridfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 </reference/write-concern/>`
page in the Server manual.

Upload a File Using an Input Stream
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit b97b1e8

Please sign in to comment.