码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB学习

时间:2015-10-19 16:58:06      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

查找表中 t 时间字段大于 ‘2015-10-01 10:10:10’ 且小于‘2015-10-15 10:10:10’ 且在存在 x字段 且 x字段值 包含‘abc‘的所有行

{

"t": {"$gt": "2015-10-01 10:10:10", "$lt":"2015-10-15 10:10:10"},

"x": {"$ne": null, "$exists":true, "$regex": ‘.abc.‘, "$options": ‘i‘}

}

类似:select * from mongodb.collections where t>‘2015-10-01 10:10:10‘ and t<‘2015-10-15 10:10:10‘ and x <> null and x like ‘%abc%‘

MongoDB学习

标签:

原文地址:http://www.cnblogs.com/fery/p/4892242.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!