1

I wonder if it is possible to find an object list by any field. Something like below?

public interface MyRepo extends MongoRepository<MyObject,String>{
    List<MyObject> findByAnyField(String query);
}
N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46
Ismail Sahin
  • 2,640
  • 5
  • 31
  • 58

1 Answers1

2

This feature is not supported by Spring Data MongoDB. Derived repository query methods support either regular or geo queries.

You can implement find-by-any field yourself, see Searching for value of any field in MongoDB without explicitly naming it

Community
  • 1
  • 1
mp911de
  • 17,546
  • 2
  • 55
  • 95