【发布时间】:2018-02-08 02:27:53
【问题描述】:
我正在尝试通过以下查询在 cosmosdb 中使用 groupby 进行查询,
var result = client.CreateDocumentQuery<Login>(documentUri)
.Where(i => i.logevent == "Success" && i._ts > 1517405472 && i._ts <= 1518010272)
.GroupBy(t => t._ts);
它会抛出以下错误
DocumentQueryException:查询表达式无效,表达式 https://documents.azure.com/dbs/colls/test.Where(i => (((i.logevent == “成功”) AndAlso (i._ts > 1517405472)) AndAlso (i._ts t._ts) 不受支持。支持的 表达式是 'Queryable.Where', 'Queryable.Select' & 'Queryable.SelectMany
【问题讨论】:
-
您可以尝试关注由 Larry Maccherone 撰写的 documentdb-lumenize,以在 DocumentDB 中提供聚合(分组、数据透视表和 N 维立方体)和时间序列转换作为存储过程。跨度>
标签: c# azure azure-cosmosdb