- In the field ‘Request’ we’ll enter a general name for the example.
- We’ll choose ‘Post’ and enter the service address for Accounts - https://apps.simbla.com/parse/classes/Accounts
- In the field ‘Post Data’ we’ll enter the following value:
{
"_method":"get"
{
- In the Header we’ll add three values:
1. Content-Type: application/json
2. X-Parse-Application-Id: Your application ID
3. X-Parse-Master-Key: Your Master Key
Now, once we examine the service (clicking Test), we’ll receive a list of clients’ objects existing within the database.
At this point, we’ll change the content of ‘Post’ and add a condition/filter Accounts by the name equals to John:
{
“_method”:”get”,
“where”:{“Name”:”John”}
}
Let test it again.
The following is a list of usable operations:
Key Operation
$lt Less Than
$lte Less Than Or Equal To
$gt Greater Than
$gte Greater Than Or Equal To
$ne Not Equal To
$in Contained In
$nin Not Contained in
$exists A value is set for the key
$select This matches a value for a key in the result of a different query
$dontSelect Requires that a key’s value not match a value for a key in the result of a different query
$all Contains all of the given values
$regex Requires that a key’s value match a regular expression
$text Performs a full text search on indexed fields
Additional examples:
Retrieve accounts where name like Jo.
{
"_method":"get",
"where":{"Name":{"$regex":"^Jo"}}
}
Retrieve accounts where name is John and Phone Number is like 054.
{
"_method":"get",
"where":{"PhoneNumber":{"$regex":"^054"}, "Name":"John"}
}
retrieve scores between 1000 and 3000, including the endpoints, we could issue:
{"score":{"$gte":1000,"$lte":3000}}'
retrieve scores equal to an odd number below 10, we could issue:
{"score":{"$in":[1,3,5,7,9]}}
Read here the complete manual of the Rest API:
https://docs.parseplatform.org/rest/guide/