模糊查询: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}})

04-28 11:48