Setting Query Options in Node.js OJAI
There are two categories of options you can set in your Node.js OJAI application. This topic describes both and shows you how to set each.
Setting Query Options Using a Node.js OJAI Method Call
Option Name | Description |
---|---|
ojai.mapr.query.include-query-plan |
Enables or disables availability of the query plan for retrieval Value: Default: |
ojai.mapr.query.timeout-milliseconds |
Query timeout in milliseconds Maximum allowed value is 2147483647. Default: None; no timeout |
To set any of these query options, you must pass the option as the second parameter in the
DocumentStore.find
method.
The following code snippet sets the query timeout to 3000 milliseconds:
const docStream = store.find( query, { 'ojai.mapr.query.timeout-milliseconds': 3000 } );
Setting Query Options in Node.js Using OJAI Query Syntax
OJAI Query Options describes query options that are
available in all OJAI clients. To use these options in Node.js OJAI, you must construct
your query in JSON format and use the $options
keyword. See OJAI Query Syntax
for details about the syntax, including an example.