Reputation: 5733
I use this query and I will make the search case insensitive:
@Query("{ $or: [ { 'name' : { $regex: ?0 }, 'number' : { $regex: ?1 } } ] }")
Is there a possibility to do this?
Upvotes: 0
Views: 2394
Reputation: 2365
You can use options to force case insensitivity: $options: 'i'
@Query("{ $or: [ { 'name' : { $regex: ?0 }, 'number' : { $regex: ?1 } } ], { $options: 'i' } }")
Upvotes: 2