1. January 2012 18:09
In an upcoming build of RavenDB (current is 588) you will be able get document's metadata wiithout having to loading it:
JsonDocumentMetadata docMetaData = store.DatabaseCommands.Head(string key);
...where docMetaData will be null when the document does not exist.
If all you want to do is check if it exists, one can use an extension method (guards omitted for berevity):
public static cass IDocumentStoreExtensions
public static bool Exists(this IDocumentStore documentStore, string key)
return documentStore.DatabaseCommands.Head(key) != null;