Here is my document:
@Document(collection = "posts")
public class Post {
@Id
String id;
String title;
String description;
}
I'm trying to query for posts with title or description with a like operator. My Repository
public class PostsRepository extends MongoRepository<Post, String> {
@Query(value = "{ $or: [ { 'title' : ?0 }, { 'description' : ?0 } ] }")
Page<Post> queryByTitleOrDescription(String query, Pageable pageable);
}
How do i perform this query with LIKE on both fields with an or between them?