I'm currently doing:
criteria = new Criteria().andOperator(where("car.color").is(car_color),
where("car_size").is(car_size))
How to make this search works for both car_color = BLUE
and car_color = blue
?
Update:
This partially works:
where("car.color").regex(car_color, "i"),
But then all values below would be updated:
BLUE
BBLUE
blue
bluee
And I want to update only what is matched in the car_color
variable(case insensitive).
The solution for my problem is:
criteria = new Criteria().andOperator(where("car.color").regex("^" + car_color+ "$", "i"),
where("car_size").is(car_size))