Spring Data MongoDB LIKE Query Insensitive Case ‘%%’

By | August 20, 2018

With spring data mongoDB you can do “LIKE QUERY” like example below.

Query query = new Query();
query.addCriteria(Criteria.where("name").regex("yourString", "i"));
mongoTemplate.find(query, CodingExample.class)

Spring Data MongoDB LIKE Query Insensitive Case

Spring Data MongoDB LIKE Query Insensitive Case

Spring Data MongoDB

The Spring Data MongoDB project provides integration with the MongoDB document database. Key functional areas of Spring Data MongoDB are a POJO centric model for interacting with a MongoDB DBCollection and easily writing a Repository style data access layer.

If you need more query regex example, please go to the official mongo regex documentation or spring data mongoDB.

Leave a Reply

Your email address will not be published. Required fields are marked *