想从某个字段中查找字符串存不存在,特殊字符需要转义处理
db.getCollection('col').find({"url": /^https:\/\/aa.bb.com\/cc\?aa=aa/})
从col表中查找url字段中存在https://aa.bb.com/cc?aa=aa的记录
想从某个字段中查找字符串存不存在,特殊字符需要转义处理
db.getCollection('col').find({"url": /^https:\/\/aa.bb.com\/cc\?aa=aa/})
从col表中查找url字段中存在https://aa.bb.com/cc?aa=aa的记录
本文标题:mongo 查找字符串是否存在
本文链接:https://www.haomeiwen.com/subject/alofbrtx.html
网友评论