From b97b1e8c609f232491d0c96cebe925e9f2b5b00b Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Thu, 6 Jun 2024 11:24:00 -0400 Subject: [PATCH] DOCSP-4079: GridFS write concern (#547) * DOCSP-4079: GridFS write concern * fix * format * tech review (cherry picked from commit 911e639c8d6e2250f02804329d4cffadd3bb07f7) --- source/fundamentals/gridfs.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~