Skip to content

Commit

Permalink
combine filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Knerio committed Nov 29, 2024
1 parent 24b838a commit 223b034
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.UpdateOptions;
import com.mongodb.client.result.UpdateResult;
import eu.koboo.en2do.mongodb.exception.methods.MethodUnsupportedException;
Expand Down Expand Up @@ -105,7 +106,7 @@ private Object executeMethod(IndexedMethod<E, ID, R> indexedMethod, Object[] arg
case EXISTS:
return collection.countDocuments(filter) > 0;
case FILTER:
findIterable = repositoryMeta.createIterable((Bson) arguments[arguments.length - 1], methodName);
findIterable = repositoryMeta.createIterable(Filters.and((Bson) arguments[arguments.length - 1], filter), methodName);

if (method.getReturnType().isAssignableFrom(Collection.class)) {
return findIterable.into(new ArrayList<>());
Expand Down

0 comments on commit 223b034

Please sign in to comment.