Documents and Collections


Documents

  • A document holds your data in a JSON format object
  • For more information about a document, see Document View

Collections

  • Collections are used to group documents together so that it is convenient to apply some operation to them,
    i.e. subscribing to changes, indexing, querying, ETL, etc.

  • Every document belongs to exactly one collection.

  • Typically, a collection holds similar structured documents based on the entity type of the document.

  • Note: It is not required that documents within the same collection will share the same structure or have any sort of schema.
    The only requirement for documents to be in the same collection is that they must have the same @collection metadata property.

  • For more information see What is a Collection


The Documents View

  • Shows all collections and the documents each contains.
  • Actions such as create, delete, or export a document can be done.
Figure 1. Documents and Collections

Collection 'Categories'

  1. Recent:

    • Click on Recent to see a list of all documents from all collections in the selected database
    • Documents are ordered by the modification time
  2. Collections:

    • The existing collections in the selected database
    • The number of documents each collection has is indicated
  3. Documents:

    • The list of documents within the selected collection
    • Each column corresponds to a property in the document JSON
    • Documents are ordered by the modification time

Figure 2. Actions

Actions

  • 1
    • New Document: Create a new document (in a new collection -or- in the current collection)
    • Delete: Delete selected documents
    • Copy: Copy documents or just document IDs of selected documents
  • 2
    • Export CSV: Export the collection data into a CSV file (visible columns only -or- all documents columns)
    • Display: Customize which columns to view. A custom column can be added
  • 3
    • Patch: Patch documents in a collection or in an index.
    • Query: Query documents in a collection or in an index.
    • Conflicts: View and resolve conflicting documents. See Conflicts

Click Display to:

  • Select which columns to view
  • Reorder columns viewed
  • Add a custom column
Figure 3. Manage Displayed Columns

Manage Displayed Columns

The @hilo Collection

Figure 4. hilo collection

The @hilo Collection

  • Documents in the @hilo collection are created when the RavenDB client (Not from the studio) is creating documents (using a session) without an explicit ID.

  • The 'Max' property value that shows in the hilo doc represents the largest ID number that was used for a client generated document in that collection.

  • For more information about the HiLo Algorithm, see HiLo Algorithm.

The @empty Collection

Figure 5. empty collection

The @empty Collection

  • The @empty collection includes:

    1. Documents that were created with a GUID identifier (but only from the 'Recent' tab)
    2. Documents that were created with a Semantic ID that was not ended with (/) or (|)
  • For more information about the various documents identifiers that can be generated, see Create New Document.