Case insensitive search in Mongo

前端 未结 5 2078
时光说笑
时光说笑 2020-11-29 21:04

I am using a case insensitive search in Mongo, something similar to https://stackoverflow.com/q/5500823/1028488.

ie I am using a regex with options i. But I am am ha

5条回答
  •  星月不相逢
    2020-11-29 21:28

    You can use '$regex':'^win$' or /^win$/i (notice no quote on the second one)

    Source here : Regex in queries with Mongo

提交回复
热议问题