Use the Cloudant Native Query editor to create Cloudant queries by specifying selector
object and settings for retrieving specific data.
Before you begin
In the Create Cloudant Query wizard, on the
Build tab of the Cloudant Native Query editor, create and open a Cloudant
native query.
About this task
Specify the options while creating a Cloudant native query:
Procedure
-
To extract the documents with the required fields and values from a Cloudant database, specify
the JSON body in the Selector field.
-
To build the metadata table, click the Refresh Field Definitions button
in the Field definitions section.
Note: The metadata table cannot be built if the index for the selector that you specified is not
defined. For more information about creating indexes for Cloudant native queries, see
Managing indexes for Cloudant native queries.
-
In the Field definitions section, you can change the metadata that
defines the result set.
- To change the position of the columns in the query results, select a column and click
the Move Up or Move Down navigation
buttons.
- To add a column to the result set, click Add Column and specify
a column name and a JSON field, which will supply column values.
- To edit the data type of the query columns, use the Type
column.
-
To run the query and display query results even if the data cannot be properly converted to the
data type that is specified for the column, select the Ignore conversion
errors check box.
Tip: Appropriate messages are displayed in the Output view for the
data type conversion errors.
Results
The Cloudant native query is created.
What to do next
You can either run the query or save the query to a repository or a file.