Creating Sample Data
-
Sample data can be created in playground databases to enable developers to experiment with features before making changes to their actual database.
It is populated with various collections, .json documents, indexes, and document extensions. -
Many of the examples in the RavenDB documentation are based on this sample data.
Creating it will enable you to play with the data as you use the documentation to familiarize yourself with RavenDB features. -
In this page:
Create Sample Data
-
Sample data can be added only on an empty database.
-
To create sample data, you can either empty your playground database or create a new database.
-
If you plan to use multiple nodes and/or encryption in production, we recommend installing your playground database in a similar environment.
Create Sample Data
To create Sample Data:
-
Tasks tab
Click to see task options. -
Create Sample Data
Select to access the Sample Data screen. -
Create
Click the Create button to generate the Northwind sample data.
Various collections, their documents and sample indexes will be created in your database.
The Data Generated - Documents View
Documents View
- Documents tab
Click to open documents options. -
Document Collections
This is the first part of the auto-generated documentId
string.- In code, the
Id
string is all lowercase (e.g.employees/5-A
).
- In code, the
- Document Ids
Unique document identification keys. - Collection
Which collection each document is in. -
Document Extensions
This column shows which types of document extensions are included in each document.
The Indexes Generated - Indexes View
Indexes View
-
Index tab
Click to view and modify current indexes.- RavenDB's default dynamic auto-indexes are managed automatically in response to queries.
- Static Indexes can also be set up manually.
- List of Indexes
Select to see the list of current indexes. - Query this index.
A general query automatically determines the best index to query and creates new ones if a good index doesn't exist for that query.
Still, you can query specific indexes via the List of Indexes. - Edit this index.
Indexes can be modified via Studio.
Read Modifying Index Definition to learn more.
The C# Entities
The C# classes used for Sample Data document entities can also be viewed.
C# Classes
- Select Tasks tab -> Create Sample Data.
- Click to View C# classes.
-
Sample data C# code
C# classes.
Scroll in C# code section to see more.