dbshell find or findbyid
To query JSON documents in HPE Ezmeral Data Fabric Database shell, use either the find
or
findbyid
command. The find
command enables you to scan
complete tables and retrieve rows that satisfy projection and/or condition clauses. The
findbyid
command enables you to retrieve a single document with a given ID.
When you review the find
examples, note that they are sometimes shown
split across multiple lines for readability. You must enter the commands on a single line
when you run them in dbshell.
find
query requires the OJAI Distributed Query Service, you must
install the mapr-drill-internal
package on the nodes where you run dbshell.
The package is available in the Data Fabric repository from
which you download Ecosystem Packs. See Data Fabric Repositories and Packages for details.Syntax
find <table path> <options>
findbyid <table path> --id <key-row ID>
Parameters
find Options | findbyid Options | Description |
---|---|---|
(Required) |
(Required) |
Table path |
--id |
(Required) |
Document ID For conditions on a single document ID, you can provide the ID either by using
the For example, NOTE You cannot specify multiple IDs using either syntax. |
--fromid |
n/a | Document ID to start from (inclusive) |
--toid |
n/a | Document ID to stop at (exclusive) |
--limit |
n/a | Maximum number of documents to return |
--withtags , --withTags |
--withtags , --withTags |
Enables or disables printing with extended type tags Value: Default: |
--pretty |
--pretty |
Enables or disables pretty printing of documents Value: Default: |
--offset |
n/a | Omits the first n number of documents in the result |
--orderby |
n/a |
Sorts the result by the given fields Specify sort order as either ascending or descending using the keywords,
Default: NOTE The keywords ASC and DESC are case
insensitive.Syntax:
See Query with --orderby for examples. |
--c , --where |
--c , --where |
Condition, in JSON format See OJAI Query Condition Syntax for a description of the syntax. See Return Documents Using Projection and Conditions for a dbshell example that uses a condition specified in JSON format. |
--f , --fields |
--f , --fields |
Projections in JSON documents See JSON Document Field Paths for details about how to specify field paths. See Return Documents Using Projection and Conditions for an example. |
--q , --query |
n/a | Query JSON documents This option accepts a query string in JSON format with predefined keywords that define the behavior of the query. The following examples shows a query that uses three keywords:
NOTE The
find command does not allow --query to work
with other options, such as --fields , --where ,
and --orderby . For example, the following command ignores the
--f
option:
In
addition, you should not enter the same keyword
twice:
See Query with --query for more examples. |