Originally on SO.
I'm trying to run aggregate with projection but i get NotSupportedException: $project or $group does not support <document>. I am running version 2.4.4 of driver with mongodb v3.4.
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
var filter = Builders<T>.Filter.Regex(x=>x.Value,"/test/gi"); var aggregate = collection.Aggregate() .Match(filter) .Project(x => new { Idx = x.Value.IndexOf("test"), Result = x } .SortBy(x => x.Idx);
I thought IndexOfCP is supported.
What am i doing wrong here?
- duplicates
-
CSHARP-2071 Using Linq Aggregation to project the root document
- Closed
- related to
-
CSHARP-2071 Using Linq Aggregation to project the root document
- Closed