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

Time for action – copying the data document to the clipboard

We will take a look at how to utilize the Copy Document(s) to Clipboard feature of the Management Studio.

  1. In the Management Studio, click on the Databases link to display the Databases screen.
  2. Select the Sales database and then click on the Documents tab to display the Documents screen. (You can also select the Collections tab and display the Collections screen.)
  3. Select a document in the list and right-click on it to show the contextual menu and select Copy Document(s) to Clipboard. You may need to select multiple documents from the documents list; to do so you can group documents using the Shift or the Ctrl key.
  4. Open the Notepad application (or your favorite text editor).
  5. Press Ctrl + V to paste the document data in the Notepad and view it.

What just happened?

In steps 1 to 5, we copy the data of one document from the Sales database using copy to clipboard Management Studio's feature and paste it in the Notepad application.

Deleting the Documents, Collections, Indexes, or Databases

This topic describes how to delete different objects from RavenDB using the Management Studio. In order to delete any object, you need to select it and then right-click on it and select Delete, you can also press the Delete key or use the Delete toolbar key from the Documents screen to delete a document when it is loaded in the editing screen.

You can delete a bulk of documents based on their collection association. Since a collection is just a logical unit in RavenDB, there is no actual meaning in deleting a collection. By deleting a collection, you are telling RavenDB to delete all the documents sharing the same entity name which is equal to the name of the collection you are asking to delete.

You can use the Delete all Indexes button in the Indexes screen of the Management Studio to delete all the indexes of a given database. When used, all the indexes will be deleted, except from Raven/DocumentsByEntityName which is the index used by the Management Studio.