【发布时间】:2020-07-24 12:57:53
【问题描述】:
我想在文档中搜索具有特殊字符的值,例如 ? ! $ / . @ > # 。
我想搜索?test等值,
例如,
db.myCollection.find({ myKey : /.*?test.*/i });
或
db.myCollection.find({ myKey : { '$regex' : '.*?test.*','$options' : 'i' });
我应该在这里改变什么?
【问题讨论】:
标签: node.js regex mongodb special-characters string-matching