Managing JSON Collections

You can add, view or drop collections, or browse, add, edit and delete JSON documents in a collection.

  • Create a Collection: See Creating a Collection

  • Add or Edit Documents in a Collection: See About Adding or Editing a JSON Document

  • View Documents in a Collection: Select the collection name in the left pane. The documents in the collection are displayed in the right pane.

  • View Collection Details: Select the specific collection in the left pane, and then click Collection Details collection details icon in the right pane toolbar to view collection properties, JSON data guide (if created) and related statistics if gathered, the size of search index, and the page for managing JSON indexes.

  • Drop a Collection: Right-click a collection name in the left pane to open the context menu. Select Drop to remove the collection from the database completely.

Creating a Collection

This section describes how to create a collection.

  1. When you navigate to the JSON page:
    • If there are no collections created, you see the JSON home page. Click Create Collection.

    • If there are existing collections available, then in the left pane, click Create Collection new collection icon.

  2. Enter the collection name, which is case sensitive.
  3. If the MongoDB Compatible option is selected, then the document IDs will be Embedded IDs.
    • Document IDs are part of the JSON document (field name is "_id"). If an _id field is missing, it is generated and added to the JSON document.

    • This collection is MongoDB compatible. MongoDB drivers connecting to the MongoDB API for the Oracle Database can read and write to this collection.

    • To use these collections from SODA, you need a SODA driver that supports the EMBEDDED_OID key assignment method.

    • This method is documented as EMBEDDED_OID.

    • The name of the content column (the column where JSON documents are stored) in the underlying table is DATA.

    Out of line IDs:

    • SODA always generates the ID for a new document.

    • The ID is not embedded in the JSON document but stored separately.

    • MongoDB drivers connecting to the MongoDB API for the Oracle Database can only read from this collection.

    • This method is documented as UUID.

    • The name of the content column in the underlying table is JSON_DOCUMENT.

  4. Click Create to create the collection.

    Click Cancel or press the Esc key to cancel the collection.

About Adding or Editing a JSON Document

You can add and edit JSON documents using the JSON editor.

To add a document, click New JSON Document New JSON Document icon in the right pane toolbar for a specific collection. In the JSON editor, you can copy and paste the JSON document or use the Import icon to import the JSON document.

To edit a document, click Edit Document edit document icon in the document card.

The following figure shows an open document in the JSON editor.

About Database Differences in JSON Documents

You can find differences in a JSON document that has been edited from two different connections.

At the time of saving an edited document, you are notified that there are differences between your edited document and the instance of the document in the database. The differences are also highlighted enabling a quick review.

Click Overwrite if you prefer to overwrite the changes to the document instance in the database.

Figure 4-1 Differences in the Document Displayed

Description of Figure 4-1 follows
Description of "Figure 4-1 Differences in the Document Displayed"