Summary
When provided an expression that was generated by a tool (such as `Mapster`), the driver appears to alias unnamed parameters with underscores, which results in a mongodb query exception such as `Command aggregate failed: '_p1' starts with an invalid character for a user variable name.`
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
Driver 2.15.0
How to Reproduce
Manually creating an Expression against a `IMongoCollection.AsQueryable()` should result in the error.
Additional Background
General usage works (normally `Select(i => new Child { Id = i.Id})` defined lambdas):
.Select(Param_0 => new ItemFacade() { Id = Param_0.Id.ToString() Children = Param_0.Children.Select(i => new ChildFacade() {ChildId = i.ChildId}) { "$map" : { "input" : "$Children", "as" : "i", "in" : { "ChildId" : "$$i.ChildId" } } }
But if the expression was generated by a tool that doesn't name parameters, it results in that mongodb error:
.Select(Param_0 => new ItemFacade() { Id = Param_0.Id.ToString(), Children = Param_0.Children.Select(Param_1 => new ChildFacade() {ChildId = Param_1.ChildId}) }) { "$map" : { "input" : "$Children", "as" : "_p1", "in" : { "ChildId" : "$$_p1.ChildId" } } }