Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想做一个不区分重音或大小写的查询,我有这个:
query && pipeline.unshift({ '$match': { 'name': { '$regex': new RegExp(query, 'i') } } })
我尝试了很多正则表达式,但我不知道如何使用它,请你帮帮我
$regex
$options
i
db.collection.find({ name: { $regex: "sam", $options: "i" } })
mongoplayground