In this chapter, we finally got hold of the data that we put in the database. Now, our project contains several GET endpoints to retrieve the content of the underlying database. We used CQRS to create queries, which are completely separate from the models that we have in our domain. Certainly, we had to use aggregate types to query RavenDB, since these are the document types as well. This could be avoided by splitting the state model from the aggregate, but this is something you can explore yourself.
We embraced the power of native access to the database engine to do things that would otherwise be impossible or cumbersome to do if we'd just used repositories. That's because a repository type represents a collection of aggregates of a single type, and we would get in trouble if we needed to combine data from different aggregates in a single read model.
Read models...