You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I've found the problem area but unfortunately I don't know how to fix it (not familiar with linq. yet!)
In MongoCollectionGeneric.cs - line 385
public IEnumerable Find<U, O, Z>(U template, O orderBy, int limit, int skip, String fullName, Expression<Func<T, Z>> fieldSelection)
For anonymous lambdas, the fieldSelection cast goes well but for concrete-typed lambdas, none of casts go through cause the expression in now a MemberInitExpression, so fieldSelectionExpando never gets populated.
#region Extract field names to request
var exp = fieldSelection.Body as NewExpression;
var fieldSelectionExpando = new Expando();
if (exp != null)
{
foreach (var x in exp.Arguments.OfType<MemberExpression>())
{
fieldSelectionExpando[x.GetPropertyAlias()] = 1;
}
}
else if (fieldSelection.Body is MemberExpression)
{
var me = fieldSelection.Body as MemberExpression;
fieldSelectionExpando[me.GetPropertyAlias()] = 1;
}
#endregion
Profiling mongo when running projected queries show that the reslen and bytes returned are the same as non projected queries.
Applies to both standard and linq queries.
The text was updated successfully, but these errors were encountered: