Details
-
Bug
-
Resolution: Fixed
-
Unknown
-
2.14.0
-
None
Description
In V3, this LINQ query:
Collection
.AsQueryable()
.GroupBy(doc => doc.Field)
.Select(g => new { g.Key, Take = g.Take(6) })
.ToList();
Generates:
[{ "$group" :
{ "_id" : "$Field" }}, { "$project" : { "Key" : "$_id", "Take" :
{ "$slice" : ["$$ROOT", 6] }, "_id" : 0 } }]
But fails with:
Command aggregate failed: First argument to $slice must be an array, but is of type: object.