kalahari
kalahari

Reputation: 974

findByParentIdDeletedIsFalse like query in Spring Boot MongoRepository

I know that, in MongoRepository, there are autogenerated queries like findByParentId and findByDeletedIsFalse. I want to get a result that both ByParentId and among them only the field deleted = false ones.

I did my research but not come across with such an example. Is it possible?

Upvotes: 0

Views: 165

Answers (1)

Saurabh Mehta
Saurabh Mehta

Reputation: 228

Yes , it should be work as

Considering example where i want to find user who's having email with case insensitive and deleted property set as false

So only need to combine autogenerated queries with AND operator and pass email as parameter.

Like :

findByEmailIgnoreCaseAndDeletedFalse(String email)

Upvotes: 1

Related Questions