diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java index 8b5726413..315a675ac 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java @@ -2,6 +2,7 @@ import com.xiaomi.youpin.docean.anno.Service; import dev.morphia.Datastore; +import dev.morphia.DeleteOptions; import dev.morphia.UpdateOptions; import dev.morphia.query.FindOptions; import dev.morphia.query.filters.Filter; @@ -101,6 +102,11 @@ public boolean delete(Filter filter) { return true; } + public boolean delete(Filter filter, DeleteOptions options) { + datastore.find(this.clazz).filter(filter).delete(options); + return true; + } + public boolean update(T t) { t.setUtime(System.currentTimeMillis()); datastore.merge(t);