You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: How to get full url for a document?

UrlFor is a helper method that returns full url for a given document key.


string UrlFor(string documentKey);
documentKey string Key of a document for which full url will be returned
Return Value
string Full url for a given document key

Example I

// http://localhost:8080/databases/Northwind/docs/employees/1
string url = store.DatabaseCommands.UrlFor("employees/1");

Example II

// http://localhost:8080/docs/employees/1
string url = store.DatabaseCommands.ForSystemDatabase().UrlFor("employees/1");