I've the following documents :
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 :
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 ?
Thanks.
Please look at this: 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With