I was looking to use cosmosdb to store time series data laid out in a [document-centric design](https://www.mongodb.com/blog/post/schema-design-for-time-series-data-in-mongodb). Using the official mongodb driver I tried to write some simple aggregation statements; however, I received errors stating that $unwind and $group were not supported. Given that cosmosdb was touted as a drop-in replacement to mongodb did I miss a step or is aggregation not a supported feature.

```
retrieve.Aggregate().Unwind(i => i.Observations).Group(new BsonDocument {
        {"_id", "$Observations.Success"},
        {"avg", new BsonDocument{
        {"$avg", "$Observations.Duration"}
        }}
    }).ToList();

```