Raven DB Count Queries

早过忘川 提交于 2019-12-04 08:16:29
Ayende Rahien

To get the results from the index, you can use:

session.Query<Collection>("Raven/DocumentCollections")
       .Where(x=>x.Name == "Posts")
       .FirstOrDefault();

That will give you the result you want.

For anyone still looking for the answer (this question was posted in 2011), the appropriate way to do this now is:

var numPosts = session.Query<Post>().Count();

Hope this helps...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!