Skip to content

Commit

Permalink
[enhancement] JCommon MongoDB MongoService add option for delete (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikaaa0928 authored Jul 4, 2024
1 parent ab1bd14 commit 280045f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 280045f

Please sign in to comment.