Execute DQL queries and read document data
This section shows a few DQL queries you can execute using the ptest
utility.
Additional information about using ptest
is here.
View server document data
The first example runs the ptest
tool to do the following:
- Connect to
names.nsf
on the Domino server identified asappsdb1
in the configuration file. - Execute the DQL query
form = 'server'
to find all documents that haveserver
as their form name. Effectively, it finds all server documents and reads them. - For each document found, return the named items in the response (form, servername, etc).
c:\domino-db\package>npm run ptest -- read appsdb1/names.nsf -q "form = 'server'" -p -i form,servername,netaddr_0,http_sslkeyfile,domain,administrator
ptest
returns the following JSON output. If your Domino server has more than one server it would be shown in
this response. Refer to this document for a description of the returned JSON data.
{
"documents": [
{
"@unid": "88EC7BB9B9773320852584B8005583A8",
"@created": {
"type": "datetime",
"data": "2019-11-20T15:34:02.64Z"
},
"@modified": {
"type": "datetime",
"data": "2019-12-05T21:40:02.03Z"
},
"form": "Server",
"servername": {
"type": "text",
"data": "CN=appsdb1/O=Jumbo Cloud Services",
"names": true
},
"domain": "Jumbo Cloud Services",
"administrator": {
"type": "text",
"data": "CN=Joe Admin/O=Jumbo Cloud Services",
"names": true
},
"http_sslkeyfile": "appsdb1.kyr",
"netaddr_0": "appsdb1.jumbocloudservices.com"
}
],
"errors": 0,
"documentRange": {
"total": 1,
"start": 0,
"count": 1
}
}
View person document data
This example runs the ptest
to do the following:
- Connects to
names.nsf
on the Domino server identified asappsdb1
in the configuration file. - Execute the DQL query
form = 'person'
to find all documents that haveperson
as their form name. Effectively, it finds all person documents and reads them. - For each document found, return the named items in the response (form, fullname, mailserver).
c:\domino-db\package>npm run ptest -- read appsdb1/names.nsf -q "form = 'person'" -p -i form,fullname,mailserver
The command returns the following JSON output.
{
"documents": [
{
"@unid": "381AB7D7A7C266F4852584B80055850B",
"@created": {
"type": "datetime",
"data": "2019-11-20T15:34:06.19Z"
},
"@modified": {
"type": "datetime",
"data": "2019-12-04T14:23:40.66Z"
},
"form": "Person",
"fullname": {
"type": "text",
"data": [
"CN=Joe Admin/O=Jumbo Cloud Services",
"Joe Admin"
],
"names": true
},
"mailserver": {
"type": "text",
"data": "CN=appsdb1/O=Jumbo Cloud Services",
"names": true
}
},
{
"@unid": "00272217332B0307052584C4006FB9C0",
"@created": {
"type": "datetime",
"data": "2019-12-02T20:20:20.48Z"
},
"@modified": {
"type": "datetime",
"data": "2019-12-04T20:51:39.57Z"
},
"form": "Person",
"fullname": {
"type": "text",
"data": [
"CN=iam application/O=Jumbo Cloud Services",
"iam application"
],
"names": true
},
"mailserver": {
"type": "text",
"data": [
""
],
"names": true
}
}
],
"errors": 0,
"documentRange": {
"total": 2,
"start": 0,
"count": 2
}
}
Next steps
ptest
is not only an administrator tool. Any user configured with a trusted client certificate
can use ptest
to examine data in a Domino database to which they have access.