ycvodzf 发表于 2017-5-1 09:45:59

python mongodb 正则查询

result = db.devices.find({'$and':[{'stats.fwver': v},{'username':{'$regex':r'(?i)ltu'}}]})#匹配ltu

result = db.devices.find({'$and':[{'stats.fwver': v},{'username':{'$regex':r'^[\d+]'}}]})#匹配数字
页: [1]
查看完整版本: python mongodb 正则查询