summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/delete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/ops/delete.cpp')
-rw-r--r--src/mongo/db/ops/delete.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/mongo/db/ops/delete.cpp b/src/mongo/db/ops/delete.cpp
index ecf4f752873..86ed88395b5 100644
--- a/src/mongo/db/ops/delete.cpp
+++ b/src/mongo/db/ops/delete.cpp
@@ -38,41 +38,41 @@
namespace mongo {
- /* ns: namespace, e.g. <database>.<collection>
- pattern: the "where" clause / criteria
- justOne: stop after 1 match
- god: allow access to system namespaces, and don't yield
- */
- long long deleteObjects(OperationContext* txn,
- Database* db,
- StringData ns,
- BSONObj pattern,
- PlanExecutor::YieldPolicy policy,
- bool justOne,
- bool god,
- bool fromMigrate) {
- NamespaceString nsString(ns);
- DeleteRequest request(nsString);
- request.setQuery(pattern);
- request.setMulti(!justOne);
- request.setGod(god);
- request.setFromMigrate(fromMigrate);
- request.setYieldPolicy(policy);
+/* ns: namespace, e.g. <database>.<collection>
+ pattern: the "where" clause / criteria
+ justOne: stop after 1 match
+ god: allow access to system namespaces, and don't yield
+*/
+long long deleteObjects(OperationContext* txn,
+ Database* db,
+ StringData ns,
+ BSONObj pattern,
+ PlanExecutor::YieldPolicy policy,
+ bool justOne,
+ bool god,
+ bool fromMigrate) {
+ NamespaceString nsString(ns);
+ DeleteRequest request(nsString);
+ request.setQuery(pattern);
+ request.setMulti(!justOne);
+ request.setGod(god);
+ request.setFromMigrate(fromMigrate);
+ request.setYieldPolicy(policy);
- Collection* collection = NULL;
- if (db) {
- collection = db->getCollection(nsString.ns());
- }
+ Collection* collection = NULL;
+ if (db) {
+ collection = db->getCollection(nsString.ns());
+ }
- ParsedDelete parsedDelete(txn, &request);
- uassertStatusOK(parsedDelete.parseRequest());
+ ParsedDelete parsedDelete(txn, &request);
+ uassertStatusOK(parsedDelete.parseRequest());
- PlanExecutor* rawExec;
- uassertStatusOK(getExecutorDelete(txn, collection, &parsedDelete, &rawExec));
- std::unique_ptr<PlanExecutor> exec(rawExec);
+ PlanExecutor* rawExec;
+ uassertStatusOK(getExecutorDelete(txn, collection, &parsedDelete, &rawExec));
+ std::unique_ptr<PlanExecutor> exec(rawExec);
- uassertStatusOK(exec->executePlan());
- return DeleteStage::getNumDeleted(exec.get());
- }
+ uassertStatusOK(exec->executePlan());
+ return DeleteStage::getNumDeleted(exec.get());
+}
} // namespace mongo