我想搜索文档中具有特殊字符(例如“+”)的值。
variable = 'test+test.test';
Run Code Online (Sandbox Code Playgroud)
我想用 搜索值.*variable.*,
例如,
db.myCollection.find({ myKey : { '$regex' : '.*variable.*','$options' : 'i' });
Run Code Online (Sandbox Code Playgroud)
以上查询不起作用