Search code examples
c#nosqlravendb

NOSQL (RavenDB) Query from a folder on C: Drive


I have a database on the C drive and I need to query from it to get all of the names of restaurants. I'm new to RavenDB and can't seem to find any documentation on how to query from a folder that sits on the C drive of the computer. Does anyone have any idea on how to do this?


Solution

  • If the database was created in drive C at creation time, then RavenDB knows where it is located.
    Run your RavenDB server.
    Specify your localhost URL when initializing the store:

      var store = new DocumentStore
                {
                    Urls = new[] {"http://127.0.0.1:8080"},
                    Database = "your-database-name"
                };
    
      store.Initialize();
    

    After that, you just query your database.

    If you manually moved the database from its original created location to some other folder then you couldn't query.

    You can Export the database and Import it to a new database in a new location.