This section describes how to query JSON documents using either the
find or findbyid command in HPE Ezmeral Data Fabric Database Shell (dbshell). It
introduces the functionality the find command supports and describes the two
ways to specify your queries. It also provides links to reference pages and
examples.
The findbyid command allows you to retrieve a single document with
a specified id from a HPE Ezmeral Data Fabric Database JSON table.
The find command allows
you to specify projections and filter conditions (using JSON strings) to retrieve specific
documents. It also allows you to specify the following options:
% mapr dbshellFor a complete list and description of options available, see dbshell find or findbyid.
You can construct your dbshell queries in one of two ways:
find command--query option in the find command and specify
keywords as arguments to --queryThe following example illustrates the differences between the two alternatives.
Suppose you want to query the table /apps/tab with the following
criteria:
f1 and f2f3 equals 15f1Click on each of the following tabs to see the syntax for each alternative:
findfind /apps/tab --fields f1,f2 --limit 10 --offset 2 --where {"$eq":{"f3":15}} --orderby f1
--query Option in findfind /apps/tab --query {"$select":["f1","f2"],"$limit":10,"$offset":2,"$where":{"$eq":{"f3":15}},"$orderby":"f1"}
For more examples on how to use the two query alternatives, see the following links:
Use Individual Options in find |
Use the --query Option in find |
|---|---|
| Query Examples with Other Options |