关于
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}})
LIKE模糊查询userName以字母A开头的数据(A%)。
SQL:SELECT * FROM UserInfo WHERE userName LIKE "A%"
MongoDB:db.UserInfo.find({userName :/^A/})
转载参考:http://blog.csdn.net/5iasp/article/details/20714943
http://blog.csdn.net/sgear/article/details/8649550