MongoDB原始查询中的正则表达式
我将如何在mongo db的原始查询上应用正则表达式? 我试过了MongoDB原始查询中的正则表达式,mongodb,django-mongodb-engine,Mongodb,Django Mongodb Engine,我将如何在mongo db的原始查询上应用正则表达式? 我试过了 {'foo.bar': {$regex:'.*test.*'}} 但django shell抱怨语法无效 我也试过了 {'foo.bar': '.*test.*'} 假设regex将生效。但结果是空的 提前谢谢 它(也是){“foo.bar”:/*test.*/}在shell上-你试过了吗?请参见尝试引用“$regex”
{'foo.bar': {$regex:'.*test.*'}}
但django shell抱怨语法无效
我也试过了
{'foo.bar': '.*test.*'}
假设regex将生效。但结果是空的
提前谢谢 它(也是){“foo.bar”:/*test.*/}
在shell上-你试过了吗?请参见尝试引用“$regex”