You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 4.2 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.

Syntax

string UrlFor(string documentKey);

Parameters
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");