Streamlined RavenDB, Part I
Join the DZone community and get the full member experience.Join For Free
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.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.