Details
-
New Feature
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
Description
I am using a multi tenant database and we would like to divide up the costs based on storage. To find out the amount of data i would like to make use of the bsonsize group operator.
With the
C# code
var match = new BsonDocument
{ {
"$match", new BsonDocument
{
Unknown macro: {
"_id.DesignId", new BsonBinaryData(designId, GuidRepresentation.Standard)
}
}
} };
var group = new BsonDocument
{ {
"$group", new BsonDocument
Unknown macro: {
{ "_id", BsonNull.Value }
,
{ "size", new BsonDocument {
Unknown macro: { "$bsonSize", "$$ROOT" }
} },
}
} };
var result = collection.Aggregate(PipelineDefinition<T, BsonDocument>.Create(match, group)).ToEnumerable().ToList();
I get the error:
MongoDB.Driver.MongoCommandException: Command aggregate failed: unknown group operator '$bsonSize'.