Skip to content

Commit

Permalink
Issue #707 removed fieldsToReturn() since it got replaced with the pr…
Browse files Browse the repository at this point in the history
…ojection in getAllFromCollectionTailable
  • Loading branch information
FJThiel committed Oct 14, 2024
1 parent 6d779ae commit 3dbc117
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
17 changes: 0 additions & 17 deletions bouncer/src/repo/core/handler/repo_database_handler_mongo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,23 +305,6 @@ bool MongoDatabaseHandler::dropDocument(
return success;
}

mongo::BSONObj MongoDatabaseHandler::fieldsToReturn(
const std::list<std::string>& fields,
bool excludeIdField)
{
mongo::BSONObjBuilder fieldsToReturn;
std::list<std::string>::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<repo::core::model::RepoBSON> MongoDatabaseHandler::findAllByCriteria(
const std::string& database,
const std::string& collection,
Expand Down
10 changes: 0 additions & 10 deletions bouncer/src/repo/core/handler/repo_database_handler_mongo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>& fields,
bool excludeIdField = false);

/**
* Get large file off GridFS
* @param worker the worker to operate with
Expand Down

0 comments on commit 3dbc117

Please sign in to comment.