Reputation: 1
I have a collection in mongodb in which the _id is of type string. I am trying to fetch a data from Mongodb in springboot using findById(String id) method which is provided by MongoRepository. But the findById(String id) method seems to be case sensitive , how can i look for data in mongodb with matching id with case insensitive type.
How can same be done for MySQL using JpaRepository ?
I have tried this query
@Query("{ '_id' : { $regex: ?0, $options: 'i' } }")
UniqueCam findByUniqueCamCodeIgnoreCase(String id);
But it is not working .
Please help me solve this issue .
Upvotes: 0
Views: 24