With queries you can retrieve an array of objects by sending a GET request to the class URL. You can also send conditions in the request so the objects that you get are filtered.
In the following example we will use our Car table and send a query with the following conditions:
{car_year": "2019","car_model":"BMW"}
By default, conditions are used with an "and" operator so the results should be and array of BMW cars from 2019.
In the Header we will add 3 parameters:
1. X-Parse-Application-Id: your application Id
2. X-Parse-Session-Token: your session token (You can use an API-K X-PARSE-API-KEY instead)
3. Content-Type: application/json
Our URL will be:
https://apps.simbla.com/parse/classes/Cars/?where={"car_year": "2019","car_model":"BMW"}
The results are array of Cars from 2019 and their car_model is BMW.
Query Operators
Our API supports these comparison options:
Query Parameters:
Order results by car year descending and then car_color ascending |
Order=-car_year,car_color |
Specify a field to sort by |
order |
Limit results to 10 records |
order=car_color&Limit=10 |
Limit the number of objects returned by the query |
limit |
Skip 10 results. This can be used for paging |
order=car_color&Limit=10& skip=10 |
Use with limit to paginate through results |
skip |
Return only the following Keys in the results |
Keys=car_color |
Restrict the fields returned by the query |
keys |
Include pointer table |
Include=Color |
Use on Pointer columns to return the full object |
include |