IT:AD:Data:Db:RavenDb

Price

RavenDb is NOT free for commercial use.

Installation

Use nuget.org.

Administration

http://localhost:8080/raven/index.html

Inserting Data

//open a db server (expensive, so minimize calls to open store):
using (var documentStore = new DocumentStore("localhost",8080).Initialize()
{
  //open a session on the db server
  using (var session = documentStore.OpenSession()){
    session.Store(new MyEntity {Val1="val1", Val2="val2"});
    session.Store(new MyEntity {Val1="val2", Val2="val3"});
    ..

    //commit:
    session.SaveChanges();
  }
}

Creating Indexes

Querying

Load a single record:

session.Load<MyEntity>(id);

Alternatly:

//open a db server (expensive, so minimize calls to open store):
using (var documentStore = new DocumentStore("localhost",8080).Initialize()
{
  //open a session on the db server
  using (var session = documentStore.OpenSession()){

    //Now make a query:
    var all = session
                .Query<MyEntity>
                . WaitForNonStaleResults()
                .ToArray();
                
    return all;
    
  }
  
}