summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_base.h
diff options
context:
space:
mode:
authorIrina Yatsenko <irina.yatsenko@mongodb.com>2021-06-07 19:07:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-24 20:07:20 +0000
commit4ebd3bc28ccef7b7e1ad91ce9d3f4338b61a7d0e (patch)
tree8e70d90a99c7b47f476570a3255de5de71e4c465 /src/mongo/client/dbclient_base.h
parent6e08ac57662b82c3249d2bd2f6a02841f6bf75c5 (diff)
downloadmongo-4ebd3bc28ccef7b7e1ad91ce9d3f4338b61a7d0e.tar.gz
SERVER-57459 Make dbtests and unittests getLastError-free
Diffstat (limited to 'src/mongo/client/dbclient_base.h')
-rw-r--r--src/mongo/client/dbclient_base.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient_base.h b/src/mongo/client/dbclient_base.h
index 8cb9288e771..351fff9105c 100644
--- a/src/mongo/client/dbclient_base.h
+++ b/src/mongo/client/dbclient_base.h
@@ -687,7 +687,15 @@ public:
int options = 0);
/**
- insert an object into the database
+ * Executes an acknowledged command to insert a vector of documents.
+ */
+ virtual BSONObj insertAcknowledged(const std::string& ns,
+ const std::vector<BSONObj>& v,
+ int flags = 0,
+ boost::optional<BSONObj> writeConcernObj = boost::none);
+
+ /**
+ * Executes a fire-and-forget command to insert a single document.
*/
virtual void insert(const std::string& ns,
BSONObj obj,
@@ -695,7 +703,7 @@ public:
boost::optional<BSONObj> writeConcernObj = boost::none);
/**
- insert a vector of objects into the database
+ * Executes a fire-and-forget command to insert a vector of documents.
*/
virtual void insert(const std::string& ns,
const std::vector<BSONObj>& v,
@@ -703,7 +711,17 @@ public:
boost::optional<BSONObj> writeConcernObj = boost::none);
/**
- updates objects matching query
+ * Executes an acknowledged command to update the objects that match the query.
+ */
+ virtual BSONObj updateAcknowledged(const std::string& ns,
+ Query query,
+ BSONObj obj,
+ bool upsert = false,
+ bool multi = false,
+ boost::optional<BSONObj> writeConcernObj = boost::none);
+
+ /**
+ * Executes a fire-and-forget command to update the objects that match the query.
*/
virtual void update(const std::string& ns,
Query query,
@@ -718,6 +736,17 @@ public:
int flags,
boost::optional<BSONObj> writeConcernObj = boost::none);
+ /**
+ * Executes an acknowledged command to remove the objects that match the query.
+ */
+ virtual BSONObj removeAcknowledged(const std::string& ns,
+ Query query,
+ int flags = 0,
+ boost::optional<BSONObj> writeConcernObj = boost::none);
+
+ /**
+ * Executes a fire-and-forget command to remove the objects that match the query.
+ */
virtual void remove(const std::string& ns,
Query query,
int flags = 0,