关于mongodb按照字段模糊查询方法

关于mongodb按照字段模糊查询方法

模糊查询:tname包含某个关键字测试'

cd /opt/soft/mongodb/bin

./mongo --host 192.168.0.1  --port 17017  test

db.test_info.find({"tname": {$regex: '测试', $options:'i'}}) 

db.test_info.find({"tname": {$regex:/测试.*/i}}) 

原文地址:https://www.cnblogs.com/yangyang03/p/7679616.html