Hello,
I am using Spring data for MongoDB operation,
the Critiria is as follows:
While performing a search operation , with a search condition that containCode:Criteria.where("name").regex(searchvalue, "i")
space in between the results are not getting fetched.
for example, if I i have 2 values "medicine bills" and "medicine" in the same collection. If I search for medicine, it returns medicine bills(medicine bills is found before medicine in the collection). same way if I have bills and then bill status, bills gets returned when I search for bill status. Please help
Code:Query query = new Query( Criteria.where(propName).regex(value.toString(), "i")); return template.find(query,some.class);


Reply With Quote
