craiggwilson/fluent-mongo — Issue #46: Wcf data services support?
Author: ray2k
Created: 2012-01-18 03:22:52+00:00
State: open

I looked for a google group or craig's twitter but only found this. I'm trying to use fluentmongo as the datasource behind a wcf service, specifically, a nuget feed (the metadata, not the files). Everything works fine except for when nuget installs a package and it queries:

from p in .Packages
where p.Id.ToLower() == "lowered id of package being installed"
orderby p
select p

Which, in and of itself, ran against a MongoCollection().AsQueryable() works fine. But something is not getting translated because running this against the data service in linqpad gives the same error, and also shows up in the mongo console, which made me wonder if it is related to fluentmongo's linq translation:

Tue Jan 17 22:14:50 [conn16] assertion 10070 $where compile error ns:NuGet.Packa
ges query:{ $where: "((this.Authors === null)nullthis.Id.toLowerCase() ===
"foo")" }

The data source url ends up being http://localhost:8656/nuget/Packages()?$filter=tolower(Id) eq 'foo' which translates to .Where (p => (p.Id.ToLower() == "foo")) which seems like it SHOULD work, but it doesn't. Any ideas? Removing the .ToLower() results in no error, but nuget requires a case-insensitive search.