Archive For The “RavenDB” Category

Turning a case sensitive string into a non-case sensitive string

Here’s a trick I recently picked up when dealing with document databases. Say you need to save objects that have IDs that only differ by case, but you’re using a document DB like Raven where keys are not case sensitive. In Google Books for example, oT7wAAAAIAAJ is an article in Spanish from a Brazilian journal, […]

Read more »

RavenDB Includes – much simpler than you think

Here’s something I’ve been struggling to get my head around over the past few days as I’ve been getting deeper into RavenDB. The example usage from their help page on pre-fetching related documents: That doesn’t look too difficult at first glance – it looks pretty similar to futures in NHibernate, which I’ve used plenty of […]

Read more »

Quick-and-dirty unique constraints in Raven DB

Raven DB, like most NoSQL databases designed to be fast and scale out, does not readily support enforcing uniqueness of fields between documents. If two users must not share the same email address or Facebook ID, you cannot simply add a unique constraint for it. However, Raven DB does guarantee uniqueness in one place: each […]

Read more »

Fast empty Raven DB sandbox databases for unit tests

Say you you have some NUnit/xUnit/Mspec tests that require a live Raven DB instance. Specifically: You do not want your test to be affected by any existing documents, so ideally the Raven DB database would be completely empty. Your test may span multiple document sessions, so doing it all within a single transaction and rolling […]

Read more »