Query
The query
operation in Contendo Server allows you to search for objects based on specified criteria. You can customize
your query to include various filters, control the number of results, and manage versioning and relationships of the
objects.
Request Format
- Operation:
query
- HTTP method:
POST
- Content-Type:
application/json
,multipart/form-data
Parameters
Name | Required | Description | Link |
---|---|---|---|
statement |
Yes | The query string that defines the search criteria. | |
searchAllVersions |
No | If set to true , will search across all versions of the objects. |
Versioning |
includeRelationships |
No | If set to true , includes related objects in the query results. |
Relationships |
maxItems |
No | The maximum number of results to return. Default is 100 . |
|
skipCount |
No | The number of results to skip for pagination. Default is 0 . |
Example Request - Searching for documents authored by “John”:
curl -X 'POST' \
'{REPOSITORY_URL}' \
-H 'Content-Type: application/json' \
-d '{
"operation": "query",
"statement": "SELECT cmis:name, cmis:author FROM dog WHERE cmis:author = 'John'",
"maxItems": 10,
"skipCount": 0,
"searchAllVersions": true
}'
Response Format
- Content-Type:
application/json
- Response body: A list of objects that match the query criteria, with each object represented in JSON format.
Field Name | Condition | Description | Link |
---|---|---|---|
results[] |
Always present | Array of result objects. | |
├ properties[] / succinctProperties[] |
Always present | The properties of the result object. | Properties |
└ relationships[] |
if includeRelationships=true |
The relationships of the result object. | Relationships |
hasMoreItems |
Always present | true if more relationships exist beyond maxItems . |
|
numItems |
Always present | The total number of relationships returned. |
Example Response - List of documents by author “John”:
{
"results": [
{
"succinctProperties": {
"cmis:name": "Rex",
"cmis:author": "John"
}
},
{
"succinctProperties": {
"cmis:name": "Fido",
"cmis:author": "John"
}
}
],
"hasMoreItems": false,
"numItems": 2
}