Creating, Reading, Updating, and Deleting Documents and Tables with the MapR-DB JSON Java API Library

The basic tasks that you can perform with the API library involve the Admin, Document, DocumentMutation, QueryCondition, Table, and TableDescriptor interfaces.

Admin

Use the methods in this interface to perform these tasks:
  • Create JSON tables
  • Alter JSON tables
  • Delete JSON tables
  • List JSON tables in a folder
  • Check whether a JSON table exists
For examples of how to use this interface, see the example code for these tasks: For a full list of methods, see Admin.

Document

Use the methods in this interface to create OJAI documents. You can pass Document objects to methods in the Table interface to add documents to tables, replace documents in tables, and delete documents from tables.

For examples of how to use this interface, see the example code for these methods: For a full list of methods, see Document.

DocumentMutation

Use the methods in this interface to specify changes to make to OJAI documents. You can pass DocumentMutation objects to the Table.checkAndMutate() method or the Table.update() method to apply the changes to documents.

QueryCondition

Use the methods in this interface to specify conditions for returning results from queries on tables. See Querying with Conditions for more information.

Table

Use the methods in this interface to perform these tasks:
  • Delete documents from tables
  • Increment numeric values in documents
  • Insert documents into tables
  • Query tables to find documents
  • Replace documents
  • Update documents with the changes specified in DocumentMutation objects
For examples of how to use this interface for queries on documents, see Querying Documents with the MapR-DB JSON Java API Library.

TableDescriptor

Use the methods in this interface to perform these tasks:
  • Create tables with non-default values for one or more of their parameters
  • Alter tables
For examples of how to use this interface, see the example code for these tasks: For a full list of methods, see TableDescriptor in the Javadoc.