From 234d8ea7ca81ebf2fef880c09575a29a425c6b4b Mon Sep 17 00:00:00 2001 From: qmqz Date: Mon, 13 Jan 2025 11:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=20=E5=8F=AF=E9=80=89=E5=A4=9A=E8=AE=B0=E5=BD=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/base/database/DataBase.dart | 3 ++- lib/base/database/impl/MongoDb.dart | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/base/database/DataBase.dart b/lib/base/database/DataBase.dart index 9326fac..2fc11c8 100644 --- a/lib/base/database/DataBase.dart +++ b/lib/base/database/DataBase.dart @@ -17,7 +17,8 @@ abstract class DataBase { // 执行更新操作 Future update( - String table, Map data, dynamic condition); + String table, Map data, dynamic condition, + {bool multiUpdate = false}); // 执行删除操作 Future delete(String table, dynamic condition); diff --git a/lib/base/database/impl/MongoDb.dart b/lib/base/database/impl/MongoDb.dart index 2d6209e..be28bf2 100644 --- a/lib/base/database/impl/MongoDb.dart +++ b/lib/base/database/impl/MongoDb.dart @@ -45,7 +45,9 @@ class MongoDb implements DataBase { @override Future update( - String table, Map data, dynamic condition) async { - await getCollection(table).update(condition, data); + String table, Map data, dynamic condition, + {bool multiUpdate = false}) async { + await getCollection(table) + .update(condition, data, multiUpdate: multiUpdate); } }