How to create a RavenDB Explorer?

I would like to write my own simple desktop-based RavenDB Explorer, similar to the web interface. This is for studying Raven, basically.

So, my first task is to read all the documents from db, it doesn’t matter which application they belong to. I would like to achieve this using the client API, but it looks like session.Query and session.LuceneQuery requires a class specifier.

Which API should be used for this task?

+3
source share
2 answers

The Client API requires a type because it is designed to work with the POCO CLR and therefore handles the conversion (from Json) for you.

Json , . , -. Java- Script, , .

, "Raven/DocumentsByEntityName", . "Raven-Entity-Name" ( CLR), . , Raven, Json CLR. .

+3

RavenDB Json:

var docStore = new DocumentStore { Url = "http://localhost:8080" };
using (docStore.Initialize())
{
    var docs = docStore
        .DatabaseCommands
        .Query("Raven/DocumentsByEntityName", new IndexQuery());
}
+7

Source: https://habr.com/ru/post/1752041/


All Articles