Search...
Count
Count the number of items that match a filter.
Syntax
function Count(collectionName: string, filter: _com_wixpress_cloud_externaldb_api_Filter, requestContext: _com_wixpress_cloud_externaldb_api_RequestContext): Count<_com_wixpress_cloud_externaldb_api_CountResponse>
Count Parameters
NAME
TYPE
DESCRIPTION
collectionName
string
The collection or table to be queried.
filter
_com_wixpress_cloud_externaldb_api_Filter
A query filter.
requestContext
_com_wixpress_cloud_externaldb_api_RequestContext
The request context object.
Returns
Status/Error Codes:
400 - Invalid query.
Return Type:
_com_wixpress_cloud_externaldb_api_CountResponse
NAME
TYPE
DESCRIPTION
totalCount
integer
The number of items in the collection that match the query filter.
Was this helpful?
Count items in a collection that match a filter.
Request
curl
Copy Code
1curl -X POST 'https://mysql-adapter.com/data/count' \2--header 'Content-Type: application/json' \3--data-raw '{4 "requestContext": {5 "settings": {6 "secretKey": "mySecureSecret"7 },8 "instanceId": "12a345b6-7890-98d7-65e4-f321abc1de23",9 "installationId": "987fe654-3d21-4def-ab5c-6d78e90f123a",10 "memberId": "77aa88bb-2c2c-d3d3-4e4e-ff55aa66bb77",11 "role": "OWNER"12 },13 "collectionName": "car",14 "filter": {15 "operator": "$contains",16 "fieldName": "make",17 "value": "Hyundai"18 }19}'
Response
json
12{"totalCount": 2}