Querying OJAI Documents

Use the find() and findById() methods of a Table object to query the documents in the JSON table that the Table object represents.

The following permissions are required for querying documents:

  • The readAce permission on the volumes where the JSON tables that contain the documents are located. For information about how to set permissions on volumes, see Setting/Modifying Whole Volume ACEs.
  • The readperm permission on the JSON tables that contain the documents. For information about how to set permissions on tables, see Enabling Table Authorizations with ACEs.
    Note: Query results exclude fields on which the user ID calling the find() or findById() method does not have the readperm permission. For information about setting permissions, see Permission Types for JSON Tables.

    In addition, reading with projected fields will not filter rows which do not have the projected fields. For fields that the user does not have read access to, those fields are assumed to be non-existent in the documents for that particular user. Since access control over the row-key is not available, even if the user does not have read permissions on a field in a table, the row-key can still be read. As of 5.2, this behavior is applicable to the find() and findById () methods of a Table object.