Ravendb - “选择”来自父实体的集合实体
我正在尝试在 raven 中创建一个索引,它将(出于所有意图和目的)投影特定用户创建的所有博客文章上的所有评论。目前我管理了一个地图语句,它只返回有评论的帖子。
from post in docs.Posts
from comment in Hierarchy(post, "Comments")
select new { comment.User, comment.Text }
最后,我想要翻阅评论,因此我需要获得所有匹配项目的平面列表。
谢谢
I am trying to create an index in raven that will (to all intents and purposes) project all comments on all blog-posts that were created by a specific user. At present I have managed a map statement, which only returns the posts that have comments.
from post in docs.Posts
from comment in Hierarchy(post, "Comments")
select new { comment.User, comment.Text }
At the end of this, I will want to page through the comments, so I need to get a flat list of all matching items.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你遇到的问题是什么?
您正在将评论数据投影出来,您需要告诉 RavenDB 存储字段,但您现在可以很好地查询它。
What is the problem that you have run to?
You are projecting the comment data out, you need to tell RavenDB to store the fields, but you can now query it just fine.