summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern_options.h
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2016-04-12 19:11:23 -0400
committerJudah Schvimer <judah@mongodb.com>2016-04-12 19:11:23 -0400
commit7ed530a55304bd9cc2b80c054f379b10d9cea8e2 (patch)
treeff1dac44961da031f3369f0288fb38a347d0d690 /src/mongo/db/write_concern_options.h
parentb0c0acc6767a74ed2e5aa50361ad4474291951f9 (diff)
downloadmongo-7ed530a55304bd9cc2b80c054f379b10d9cea8e2.tar.gz
SERVER-20224 commands that write support writeConcern
Diffstat (limited to 'src/mongo/db/write_concern_options.h')
-rw-r--r--src/mongo/db/write_concern_options.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/write_concern_options.h b/src/mongo/db/write_concern_options.h
index 0c187ed2887..f969fc08031 100644
--- a/src/mongo/db/write_concern_options.h
+++ b/src/mongo/db/write_concern_options.h
@@ -64,6 +64,15 @@ public:
Status parse(const BSONObj& obj);
/**
+ * Attempts to extract a writeConcern from cmdObj.
+ * Verifies that the writeConcern is of type Object (BSON type).
+ */
+ static StatusWith<WriteConcernOptions> extractWCFromCommand(
+ const BSONObj& cmdObj,
+ const std::string& dbName,
+ const WriteConcernOptions& defaultWC = WriteConcernOptions());
+
+ /**
* Return true if the server needs to wait for other secondary nodes to satisfy this
* write concern setting. Errs on the false positive for non-empty wMode.
*/
@@ -95,6 +104,9 @@ public:
// Timeout in milliseconds.
int wTimeout;
+
+ // True if the default write concern was used.
+ bool usedDefault = false;
};
} // namespace mongo