using $regex in mongodb, I want to find the name B&B Hôtel
which contain some special characters like &
and ô
by typing BB Hotel
.
I tried this code:
db.txt.find({ "name": {'$regex': query, $options:'i'}})
where query
can be BB Hotel
.