From 3dbc117e189fd29f9c37d8a8c67f842fdb7a9b51 Mon Sep 17 00:00:00 2001 From: Felix Thiel Date: Mon, 14 Oct 2024 16:20:48 +0100 Subject: [PATCH] Issue #707 removed fieldsToReturn() since it got replaced with the projection in getAllFromCollectionTailable --- .../handler/repo_database_handler_mongo.cpp | 17 ----------------- .../core/handler/repo_database_handler_mongo.h | 10 ---------- 2 files changed, 27 deletions(-) diff --git a/bouncer/src/repo/core/handler/repo_database_handler_mongo.cpp b/bouncer/src/repo/core/handler/repo_database_handler_mongo.cpp index ed113fa19..732f138dc 100644 --- a/bouncer/src/repo/core/handler/repo_database_handler_mongo.cpp +++ b/bouncer/src/repo/core/handler/repo_database_handler_mongo.cpp @@ -305,23 +305,6 @@ bool MongoDatabaseHandler::dropDocument( return success; } -mongo::BSONObj MongoDatabaseHandler::fieldsToReturn( - const std::list& fields, - bool excludeIdField) -{ - mongo::BSONObjBuilder fieldsToReturn; - std::list::const_iterator it; - for (it = fields.begin(); it != fields.end(); ++it) - { - fieldsToReturn << *it << 1; - excludeIdField = excludeIdField && ID != *it; - } - if (excludeIdField) - fieldsToReturn << ID << 0; - - return fieldsToReturn.obj(); -} - std::vector MongoDatabaseHandler::findAllByCriteria( const std::string& database, const std::string& collection, diff --git a/bouncer/src/repo/core/handler/repo_database_handler_mongo.h b/bouncer/src/repo/core/handler/repo_database_handler_mongo.h index c23ef19f9..0fc23a441 100644 --- a/bouncer/src/repo/core/handler/repo_database_handler_mongo.h +++ b/bouncer/src/repo/core/handler/repo_database_handler_mongo.h @@ -451,16 +451,6 @@ namespace repo { const std::string &password = std::string()); - /** - * Turns a list of fields that needs to be returned by the query into a bson - * object. - * @param list of field names to return - * @param ID field is excluded by default unless explicitly stated in the list. - */ - mongo::BSONObj fieldsToReturn( - const std::list& fields, - bool excludeIdField = false); - /** * Get large file off GridFS * @param worker the worker to operate with