Mongodb Aggregation Framework:$ group是否使用索引? [英] Mongodb Aggregation Framework: Does $group use index?

查看:904
本文介绍了Mongodb Aggregation Framework:$ group是否使用索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将聚合框架与$match$group阶段一起使用. $group阶段是否使用索引数据?我正在使用最新的可用mongodb版本-2.5.4

I'm trying to use aggregation framework with $match and $group stages. Does $group stage use index data? I'm using latest available mongodb version - 2.5.4

推荐答案

$group不使用索引数据.

从mongoDB docs :

From the mongoDB docs:

$ match和$ sort管道运算符可以在索引出现在管道开头时加以利用.

The $match and $sort pipeline operators can take advantage of an index when they occur at the beginning of the pipeline.

$ geoNear管道运算符利用地理空间索引. 使用$ geoNear时,$ geoNear管道操作必须显示为 聚合管道的第一阶段.

The $geoNear pipeline operator takes advantage of a geospatial index. When using $geoNear, the $geoNear pipeline operation must appear as the first stage in an aggregation pipeline.

这篇关于Mongodb Aggregation Framework:$ group是否使用索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆