Over a million developers have joined DZone.

Streamlined RavenDB, Part I

DZone's Guide to

Streamlined RavenDB, Part I

· Database Zone
Free Resource

Learn NoSQL for free with hands-on sample code, example queries, tutorials, and more.  Brought to you in partnership with Couchbase.

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.

The Getting Started with NoSQL Guide will get you hands-on with NoSQL in minutes with no coding needed. Brought to you in partnership with Couchbase.


Published at DZone with permission of Ayende Rahien, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}