I have the following POJO.
@Document(collection = \"questions\")
public class Question {
@Id
private String id;
public List getTags()
The CONTAINING keyword may also be used:
@Repository
public interface QuestionRepository extends MongoRepository {
List findByTagsContaining(List tags);
}
example and how it's mongo query looks like:
findByAddressesContaining(Address address)
{"addresses" : { "$in" : address}}
This can also accept list of address in params.
See documentation: https://github.com/spring-projects/spring-data-mongodb/blob/e28bede416e4ddac19a35dc239388afc90b9cac4/src/main/asciidoc/reference/mongo-repositories.adoc