1. 程式人生 > >【轉】pymongo實現模糊查詢

【轉】pymongo實現模糊查詢

python article 匹配 light net details regex 使用 模糊匹配

pymongo 模糊匹配查詢
在mongo中這樣實現

{‘asr‘:/若琪/}

  

使用pymongo

兩種實現方式

1.import re
{‘asr‘:re.compile(‘若琪‘)}
2.{‘asr‘:{‘$regex‘:‘若琪‘}}

  

轉自:https://blog.csdn.net/whd0310/article/details/41895163

【轉】pymongo實現模糊查詢