Streamlined RavenDB, Part I

time to read 2 min | 312 words

One of the things that we worked very hard on (and are still working very hard) is making RavenDB as streamlined as possible, in the sense of making it very easy to do things that you commonly have to do.

Case in point, the Future Posts feature of this blog. Yesterday I went a bit overboard and posted about 10 posts in the space of two hours. (No, this isn’t my usual rate). That led to something that I didn’t quite foreseen:


We did have a limit on the number of future posts that we will show, but that limit was set to 15, and as you can see, it is actually pretty hard to look at things when we have so many, so instead I decided that we should have the following:


Just a minor UI change, but we now need to also change the data that we gather, or do we? Let us look at the code:


The only change that I actually had to do was modify the Take() from 15 to 5, and also ask the query to give me the query statistics. Because such as operation (pages + full count) is so common, RavenDB make it super cheap to do so. You don’ t need to issue a separate query, and you don’t need to do anything nor are you incurring any additional costs.

The information is already there.