summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.h
diff options
context:
space:
mode:
authorSuganthi Mani <suganthi.mani@mongodb.com>2020-09-10 13:59:12 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-19 22:11:30 +0000
commit73010da1fe57e548cf7a651361dbe6eae535b87c (patch)
tree85c967bd487e007a90003df0840f46fbacbf1d87 /src/mongo/db/dbhelpers.h
parent552c3d62daa278ef165c005cc972353860382a44 (diff)
downloadmongo-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.h21
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'.