RavenDB 2.x  Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Time for action – adding a custom metadata key

You will open a document from the Orders database in the Management Studio, add a new metadata key, and set its value.

  1. In the Management Studio, open the Document screen.
  2. Double-click on the document with the ID = Orders/B765760 (chosen arbitrary) to open it in the edit mode.
  3. Click on the Metadata tab to display metadata related to the document.
  4. Add a new custom metadata key-value, Developer-Name, and set its value to Khaled.
  5. Click on the Save button to make the changes permanent.

What just happened

You just loaded a document and added a new custom metadata key.

Metadata are key-value pairs and are stored using the JSON format. Each document may have more than one metadata. The metadata document begins with { (left brace) and ends with } (right brace).

Each key is followed by : (colon) and the key-value pairs are separated by , (comma).

So the Developer-Name represents the key name and Khaled represents the value assigned to that key name.

Note that some of the current metadata are displayed on the right-side of the edit screen.