Query Data
Overview
Section titled “Overview”This interface allows users to fetch data based on various criteria, such as entity type, sorting, filtering, and pagination. The API endpoints and their functionalities are defined through a JSON object structure.
Request
Section titled “Request”POST /{Category}/{Entity}/queryCaregory is the product name. it can be one of the following:
- carewait
- carecontrol
- careconnect
Entity please see Entity Model List
An example JSON request for querying application data might look like this:
{ "skip": 0, "take": 10, "query": { "field1": { "$gt": 100 }, "field2": { "$in": ["value1", "value2"] } }, "sort": { "field1": 1, "field2": -1 }, "fields": ["field1", "field2", "field3"], "withoutTotal": false, "distinct": false}JSON Schema
Section titled “JSON Schema”The schema for the query request is as follows:
| Field Name | Type | Description |
|---|---|---|
| skip | Integer | Number of records to skip (for pagination) |
| take | Integer | Number of records to take (for pagination) |
| query | object | Defines the filter criteria (MongoDB style query) |
| sort | object | Specifies sorting order of the result fields |
| fields | array | Specifies which fields to include in the response |
| withoutTotal | bool | If true, does not include total count of records |
| distinct | bool | If true, returns only distinct records |
Filter and Sort
Section titled “Filter and Sort”-
Query: The
Queryfield uses a MongoDB-like syntax for filtering. For instance,{"field1": {"$gt": 100}}filters records wherefield1is greater than 100. For DateTime type data, please use ISO 8601 format. If you can only filter through string type, please use theDate(ISO 8601)format, for example,{ modified: { $gt: "Date(2021-01-01T00:00:00Z)" } } -
Sort: The
Sortfield determines the sorting order of the fields. A value of1indicates ascending order, and-1indicates descending order. For example,{"field1": 1, "field2": -1}sorts byfield1in ascending andfield2in descending order.
Response
Section titled “Response”Return object list
{ "isSuccess": true, "responseStatus": { "message": "error message" }, "data": [], "totalCount": 0}