There appears to be a bug in the Linq implementation when generating a query containing an ORDER BY following a SELECT.
class Container<T>
{
public System.Guid id { get; set; }
public string Key { get; set; }
public T Content { get; set; }
}
public class Content
{
public string Version { get; set; }
}
var content = client.CreateDocumentQuery<Container<Content>>(collection.DocumentsLink)
.Where(container => container.Key == "MyKey")
.Select(container => container.Content)
.OrderBy(content => content.Version);
This generates the following query, returning zero results.
SELECT VALUE root["Content"] FROM root WHERE (root["Key"] = "MyKey") ORDER BY root["Version"] ASC
The following query returns results as expected.
SELECT VALUE root["Content"] FROM root WHERE (root["Key"] = "MyKey") ORDER BY root["Content"]["Version"] ASC
It may be related to issue #208
It repros with 1.17.0 version as well.
Any updates on this?
Bug persists also in 1.7.1! Any plan to fix this in future versions?
Also having this issue. Any update? I'm using core 1.8.1.
Still broken in Microsoft.Azure.DocumentDB.Core v1.9.1
@bchong95 please look into this.
I believe this has been fixed in 2.1.3 release. Please reopen if it's still affecting any scenarios.
Most helpful comment
Any updates on this?