In MongoDB "db.foo.find()" syntax, how can I tell it to match all letters and their accented versions?
For example, if I have a list of names in my database:
Jo?o
Fran?ois
Jesús
How would I allow a search for the strings "Joao", "Francois", or "Jesus" to match the given name?
I am hoping that I don't have to do a search like this every time:
db.names.find({name : /Fr[a?...][n?][c?][all accented o characters][all accented i characters]s/ })
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…