
上QQ阅读APP看书,第一时间看更新
Time for action – importing external data using a CSV file
You will create a new database called World
and populate it with external data which you will import using a CSV text file.
- In the Management Studio, click on the Databases link to show the Database screen.
- Click on the New Database button to open the Create New Database wizard form, then create a new database named
World
. - Click on the Tasks tab to show the Tasks screen.
- Click on the CSV Import toolbar button, this will show the CSV Import screen which contains a CSV Import button.
- Click on the CSV Import button and select the
Cities.csv
file (which is a part of the book companion package files). - Click on the Documents tab or the Collections tab to verify that the database has been populated with new 3051 documents.
What just happened?
We just created a new database named World
. Then using the Import CSV feature, we imported the Cities.csv
file and populated the database we just created.
Note
The World
database will be used and enhanced throughout the book's chapters.
Have a go hero – exporting documents from different views
Exporting the RavenDB documents to a CSV file is very easy. Depending on the screen you are viewing, you will export different results. Try to export all the documents from each view to a CSV file, where the Export To CSV feature is available (Documents, Collections, and Index Query Results).