操作方法创建以减少多个文档的索引 [英] How-to create index on multiple documents with reducing
本文介绍了操作方法创建以减少多个文档的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下文件:
public class User
{
public string Id { get; set; }
public string Email { get; set; }
public string Password { get; set; }
}
public class Book
{
public string Id { get; set; }
public string Title { get; set; }
}
public class BookFavorite
{
public string Id { get; set; }
public string UserId { get; set; }
public string BookId { get; set; }
}
我要查询的图书列表,并且对每本书的信息
I want to query the list of books and have an information on each book if user has it in favorite.
Actually a result like this :
其实这样的结果C>公共类QueryResult中
{
公共图书图书{搞定;组; }
公众用户用户{搞定;组; }
公共BOOL IsInFavorite {搞定;组; }
}
public class QueryResult
{
public Book Book { get; set; }
public User User { get; set; }
public bool IsInFavorite { get; set; }
}
我如何创建我的索引来执行?
How can i create my index to perform that ?
感谢
推荐答案
请看看这个:
的 http://ayende.com/blog/89089/ravendb-multi-maps-reduce-indexes
这表明你如何加入的文件,以示对用户的喜爱。
It shows how you can join the documents to show the favorite for the users.
这篇关于操作方法创建以减少多个文档的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文