DQL Queries
If configuration allows DQL, you can also perform DQL queries against an NSF. A form has to have a mode with the name dql
, otherwise documents with that Form are excluded from search results.
Set Up dql Mode
Back in the Domino REST API Admin UI, access the todorest Domino REST API Database again.
- Open the “todo” form and click “+ Add Mode”.
- Set the mode name as
dql
and click “Save”. - Add all fields, setting them all to Read Only.
- Click Save.
Run a Query
- Hover over the “domino-restapi-todo” collection name and click on the ellipsis (three dots). Select “Add Request”.
- Name the request “query data” and click “Save to domino-restapi-todo”.
- Change the method from “GET” to “POST”.
- Set the URL as “{{HOST}}/query?action=execute&dataSource=todorest”.
- Set the headers for “Authorization” and Content-Type.
- On the Body tab change the type to “Raw”.
-
Set the request body content to:
{ "query": "form = 'todo' and completed = ?STATUS", "maxScanDocs": 500000, "maxScanEntries": 200000, "timeoutSecs": 300, "viewRefresh": true, "noViews": false, "variables": { "STATUS": "false" } }
- Click “Send”. You will get a list of documents matching the query in the database.
- Save and close the request.
You request can be refined with count
and start
parameters, as with views.