首页 文章

Azure:不支持DocumentDB Mongo $组

提问于
浏览
15

将我的Mongo应用程序迁移到Azure上的DocumentDB后, $group 查询不再有效,并引发以下错误:

{ MongoError: '$group' is not supported',
  name: 'MongoError',
  message: '\'$group\' is not supported',
  _t: 'OKMongoResponse',
  ok: 0,
  code: 115,
  errmsg: '\'$group\' is not supported',
  '$err': '\'$group\' is not supported' }

有没有其他人遇到这个,可能有任何建议吗?

2 回答

  • 6

    有两种方法可以尝试

    (i)您可以尝试按照Larry Maccherone所写的documentdb-lumenize提供聚合 (Group-by, Pivot-table, and N-dimensional Cube) 和时间序列转换作为DocumentDB中的存储过程

    (ii)最近cosmosdb支持此功能,您可以通过预览功能窗格启用此功能并启用MongoDB聚合pipleline . 请点击以下链接

    Aggregation in cosmos-db

    enter image description here

  • 0

    对于任何试图在2018年解决此问题的人,DocumentDB现在支持此功能,但默认情况下处于关闭状态 . 您必须进入Azure中的“预览功能”窗格并启用“MongoDB聚合管道”才能访问$ group .

    对于有兴趣了解更多信息的人,他们的公告如下 .

    https://azure.microsoft.com/en-in/blog/azure-cosmosdb-extends-support-for-mongodb-aggregation-pipeline-unique-indexes-and-more/

相关问题