开发者

Order by ID in RavenDB

开发者 https://www.devze.com 2023-03-08 12:20 出处:网络
Is ther开发者_如何学Goe a way to have Raven order the results of a query by the Id field as if it was in integer.So \"cars/2\" would come before \"cars/11\" if I did this query:

Is ther开发者_如何学Goe a way to have Raven order the results of a query by the Id field as if it was in integer. So "cars/2" would come before "cars/11" if I did this query:

var cars = session.Query<Car>().OrderBy(c => c.ID);


You shouldn't rely on the id of the document to be sortable in any way. Add a CreatedAt property or something similar and use that

0

精彩评论

暂无评论...
验证码 换一张
取 消