-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: 2.14.0
-
Component/s: LINQ3
-
None
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.