I am new to RavenDB, and from my understanding, when you request a document, you will get the whole document (if you are not using some kind of index, etc.).
Scenario example
Take, for example, a script document in a blog where the document is as follows:
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 calculated set of blog entries and comments for each blog. I understand how to use paging in Blog documents using the Skip() and Take() methods. I would like to apply the swap logic to the internal Comments collection for each of the blog documents.
My questions
How can I get a page set of blogs and a page set of each of their comments?
Considering the requirements of paging, do you change the blog script of the document so that comments are not in the blog document?
source share