14

After migrating my Mongo app to DocumentDB on Azure the $group queries are no longer working and are throwing the following error:

{ 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' }

Has anyone else encountered this before and may have any suggestions?

Anshuul Kai
  • 3,876
  • 2
  • 27
  • 48
  • 4
    MongoDB interface for DocumentDB doesn't implement 100% of the MongoDB features (though the team has been actively adding features and publishing related blogs about updates). Seems like you've run into one of the not-yet-implemented operations (and I'm unaware of a page documenting what is and isn't implemented) . But... this isn't the place to start a discussion about how people feel about various feature gaps. – David Makogon Dec 27 '16 at 04:36
  • Thanks David! I wasn't sure if this was a limitation of DocumentDB or not. I've updated the question appropriately. – Anshuul Kai Dec 27 '16 at 05:16
  • Why are yo migrating to DocumentDB? IMHO you'll suffer a lot migrating to DocumentDB. – thepirat000 Dec 27 '16 at 06:08
  • @thepirat000 - This is not the place to pitch your opinion of a given product or service. You don't know a thing about the OP's product or reasons behind the migration. – David Makogon Dec 27 '16 at 11:35
  • @DavidMakogon No I don't know the reasons, that's why I'm asking. Just curiosity. – thepirat000 Dec 27 '16 at 18:21
  • 1
    DocumentDB seems to have its limitations due to which I'm no longer pursuing that route. The original reason to use it was to avoid maintaining a MongoDB cluster and/or replicas with backups that guarantee a 99.9% availability. For the price point, DocumentDB offers a lot and I'll definitely consider it once it's a little more baked. – Anshuul Kai Dec 28 '16 at 19:56
  • 2
    is there any link about the supported/unsupported features ? – dafriskymonkey Jan 11 '17 at 22:00
  • 2
    The best link I came across is their [forum](https://feedback.azure.com/forums/263030-documentdb/filters/top). Hope it helps. – Anshuul Kai Jan 12 '17 at 22:14
  • 1
    Still waiting for it... –  Mar 01 '17 at 13:58
  • 6
    DocumentDB/CosmosDB is a lie! They don't support A LOT of things (map/reduce, aggregate with group, etc.). MongoDump also fails after some documents (60Gb in my case). – JCKödel Aug 16 '17 at 19:04

2 Answers2

2

There are two ways you can try

(i) You could try to follow documentdb-lumenize wrote by Larry Maccherone to provide Aggregations (Group-by, Pivot-table, and N-dimensional Cube) and Time Series Transformations as Stored Procedures in DocumentDB

(ii)Recently this feature is supproted by cosmosdb , you can enable this by Preview features pane and turn on MongoDB aggregation pipleline. Follow the following link,

Aggregation in cosmos-db

enter image description here

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
0

For anyone trying to solve this problem in 2018+, this feature is now supported by DocumentDB, but is turned off by default. You must go into the 'Preview Features' pane in Azure and turn on 'MongoDB Aggregation Pipeline' to have access to $group.

For anyone interested in learning more, their announcement is below.

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

Matthew McClure
  • 53
  • 1
  • 10