关于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}})

更多MongoDB相关教程见以下内容

基于CentOS 6.5操作系统搭建MongoDB服务 http://www.linuxidc.com/Linux/2014-11/108900.htm

MongoDB 的详细介绍请点这里
MongoDB 的下载地址请点这里

猜你喜欢

转载自www.linuxidc.com/Linux/2016-01/126975.htm
今日推荐