craiggwilson / mongo-dotnet-odata

An OData provider for MongoDB.
22 stars 9 forks source link

Problem with sorting #4

Open cabrinoob opened 9 years ago

cabrinoob commented 9 years ago

Hi, first of all, Great job for this provider, it's very usefull. I'am trying to consume my Odata stream from Excel and power query but I have a problem when I try to sort.

In excel powerquery, when I clic on a field header to sort the Dataset, it crashes with this error :

501 Not Implemented Exception
Details : http://myserver.com/MongoData.svc/log?$skiptoken='54914ccc967a5d46ae5c9ca8'

If I copy url and paste it in my browser I have a lot more details :

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><message xml:lang="fr-FR">Not Implemented</message><innererror><message>Unable to     determine the serialization information for the expression:
 DataServiceProviderMethods.Compare(element.Id, "54914ccc967a5d46ae5c9ca8").</message>
<type>System.NotSupportedException</type><stacktrace>   at     MongoDB.Driver.Linq.Utils.BsonSerializationInfoFinder.GetSerializationInfo(Expression node,     Dictionary`2 serializationInfoCache)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildComparisonQuery(Expression     variableExpression, ExpressionType operatorType, ConstantExpression constantExpression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildOrElseQuery(BinaryExpression     binaryExpression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildOrElseQuery(BinaryExpression     binaryExpression)&#xD;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&#xD;
   at MongoDB.Driver.Linq.SelectQuery.Execute()&#xD;
  at     MongoDB.Driver.Linq.MongoQueryable`1.System.Collections.IEnumerable.GetEnumerator()&#xD;
   at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)    </stacktrace></innererror></error>

Any idea?

Thank you!

craiggwilson commented 9 years ago

I haven't looked at this codebase in a while. It would appear that some field is getting used that we don't know about. I'll have to take a deeper look when I get some time.