如何将 RavenDb 查询索引结果包含到文档中
以下两个查询均按预期工作。我无法弄清楚如何使用“Include()”方法一次从数据库返回两者。
var result = _documentsSession
.Advanced
.LuceneQuery<MessageStatisticResult, MessageSummaryByUserIndex>()
.Where("Email:" + command.UserName);
var user = _documentSession
.Load<IUser>("users/" + command.UserName);
一旦我添加“Include()”方法,Query() 和 Advance() 就不再相关。有办法做到这一点吗?
Both of the following queries work as expected. I'm having trouble figuring out how to return both from the database in one pull using the "Include()" method.
var result = _documentsSession
.Advanced
.LuceneQuery<MessageStatisticResult, MessageSummaryByUserIndex>()
.Where("Email:" + command.UserName);
var user = _documentSession
.Load<IUser>("users/" + command.UserName);
A soon as I add the "Include()" method both the Query() and Advance() are no longer relevant. Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这也会产生结果,但不会在一次访问数据库中同时获得这两个结果:
This also produces results but does not get both in one trip to the database:
最终的答案是删除我的 RavenDB 代码并从 git 重新克隆并重建。然后它工作得很好。
The final answer was to delete my RavenDB code and reclone from git and rebuild. Then it worked just fine.