Skip to content

Commit

Permalink
Match function names to that of MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
treefrogframework committed Dec 2, 2023
1 parent a12d69c commit 7358747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/tmongoquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ int TMongoQuery::update(const QVariantMap &criteria, const QVariantMap &document
Updates existing documents of the selection criteria \a criteria in
the collection with new document \a document.
*/
int TMongoQuery::updateMulti(const QVariantMap &criteria, const QVariantMap &document)
int TMongoQuery::updateMany(const QVariantMap &criteria, const QVariantMap &document)
{
int modifiedCount = -1;
QVariantMap doc;

if (!_database.isValid()) {
tSystemError("TMongoQuery::updateMulti : driver not loaded");
tSystemError("TMongoQuery::updateMany : driver not loaded");
return modifiedCount;
}

Expand All @@ -247,7 +247,7 @@ int TMongoQuery::updateMulti(const QVariantMap &criteria, const QVariantMap &doc
if (res) {
modifiedCount = reply.value(QStringLiteral("modifiedCount")).toInt();
}
tSystemDebug("TMongoQuery::updateMulti modifiedCount:%d", modifiedCount);
tSystemDebug("TMongoQuery::updateMany modifiedCount:%d", modifiedCount);
return modifiedCount;
}

Expand Down
3 changes: 2 additions & 1 deletion src/tmongoquery.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class T_CORE_EXPORT TMongoQuery {
bool insert(QVariantMap &document);
int update(const QVariantMap &criteria, const QVariantMap &document, bool upsert = false);
bool updateById(const QVariantMap &document);
int updateMulti(const QVariantMap &criteria, const QVariantMap &document);
int updateMany(const QVariantMap &criteria, const QVariantMap &document);
int updateMulti(const QVariantMap &criteria, const QVariantMap &document) { return updateMany(criteria, document); }
int remove(const QVariantMap &criteria);
bool removeById(const QVariantMap &document);
int count(const QVariantMap &criteria = QVariantMap());
Expand Down

0 comments on commit 7358747

Please sign in to comment.