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);
}
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);
}
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