diff options
author | Suganthi Mani <suganthi.mani@mongodb.com> | 2020-09-10 13:59:12 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-19 22:11:30 +0000 |
commit | 73010da1fe57e548cf7a651361dbe6eae535b87c (patch) | |
tree | 85c967bd487e007a90003df0840f46fbacbf1d87 /src/mongo/db/dbhelpers.h | |
parent | 552c3d62daa278ef165c005cc972353860382a44 (diff) | |
download | mongo-73010da1fe57e548cf7a651361dbe6eae535b87c.tar.gz |
SERVER-48796 Implement recipientSyncData command in MigrationServiceInstance.
Diffstat (limited to 'src/mongo/db/dbhelpers.h')
-rw-r--r-- | src/mongo/db/dbhelpers.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h index 339f5165455..17b1494c1ae 100644 --- a/src/mongo/db/dbhelpers.h +++ b/src/mongo/db/dbhelpers.h @@ -30,6 +30,7 @@ #pragma once #include "mongo/db/namespace_string.h" +#include "mongo/db/ops/update_result.h" #include "mongo/db/record_id.h" namespace mongo { @@ -117,14 +118,14 @@ struct Helpers { static void putSingleton(OperationContext* opCtx, const char* ns, BSONObj obj); /** - * you have to lock + * Callers are expected to hold the collection lock. * you do not have to have Context set * o has to have an _id field or will assert */ - static void upsert(OperationContext* opCtx, - const std::string& ns, - const BSONObj& o, - bool fromMigrate = false); + static UpdateResult upsert(OperationContext* opCtx, + const std::string& ns, + const BSONObj& o, + bool fromMigrate = false); /** * Performs an upsert of 'updateMod' if we don't match the given 'filter'. @@ -132,11 +133,11 @@ struct Helpers { * Note: Query yielding is turned off, so both read and writes are performed * on the same storage snapshot. */ - static void upsert(OperationContext* opCtx, - const std::string& ns, - const BSONObj& filter, - const BSONObj& updateMod, - bool fromMigrate = false); + static UpdateResult upsert(OperationContext* opCtx, + const std::string& ns, + const BSONObj& filter, + const BSONObj& updateMod, + bool fromMigrate = false); /** * Performs an update of 'updateMod' for the entry matching the given 'filter'. |