I am new to RavenDB and from my understanding, when you ask for the document, you will get the entire document (unless you use some sort of index, etc).
Example Scenario
Take for example the Blog document scenario, where the document looks like this:
public class Blog
{
public string Id { get; set; }
public string AuthorId { get; set; }
public DateTime PublishedUTC { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public Comment[] Comments { get; set; }
}
public class Comment
{
public string Id { get; set; }
public string AuthorId { get; set; }
public DateTime PublishedUTC { get; set; }
public string Content { get; set; }
}
Say we have a webpage /blogs/posts/. The page displays a paged set of the Blog Posts and the Comments for each of the blogs. I understand how to use the paging on the Blog documents with Skip() and Take() methods. I'd like to apply paging logic to the inner Comments collection for each of the Blog documents.
My Questions
How would I get a paged set of Blogs and a paged set of each of their Comments?
Given the paging requirements, would you change the given Blog document scenario so that the comments don't live within the Blog document?