摘要: mongodb聚合 db.collectionname.aggregate(AGGREGATE_OPERATION) 类似sql语句: select by_user, count(*) from mycol group by by_user 通过字段by_user字段对数据进行分组,并计算by_us 阅读全文
posted @ 2017-03-17 14:56 累累的博客 阅读(129) 评论(0) 推荐(0)
摘要: mongodb索引 ensureIndex()方法 db.collectioname.ensureIndex({"id":1}) 为字段id创建索引,1为指定按升序创建索引 -1为降序创建索引 db.collectionname.ensureIndex({open:1,close:1},{backg 阅读全文
posted @ 2017-03-17 11:15 累累的博客 阅读(125) 评论(0) 推荐(0)