This repository has been archived by the owner on Jul 28, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Sending Requests: Delete Requests.
Mihou edited this page Jun 22, 2021
·
1 revision
You can use the Queria format:
database.collection.delete(identifier, {"unique":"Unique value for callbacks,
this is optional. This will also not be added to the value, don't worry."})
If you don't need the unique value for callbacks, feel free to use below:
database.collection.delete(identifier)
Or you can choose to use the JSON
format which has fields as written below.
The method
field must be delete
for this request.
FIELD | TYPE | DESCRIPTION |
---|---|---|
method | string | The type of request to send. |
database | string | The database to store the item. |
collection | string | The collection to store the item. |
identifier | string | The identifier name of the item to remove. |
unique | string | The unique value to return (used for getting back exact responses from the server). |
FIELD | TYPE | DESCRIPTION |
---|---|---|
response | json | Replies back with something among the likes of: "The item {{identifier}} was deleted." |
kode | integer | The server reply code (1 for success, 0 for no results, -1 for invalid request). |
replyTo | string | The unique code sent back (for callbacks). |
{
"response": "The item [identifier] was deleted.",
"kode": 1,
"replyTo": "Unique identifier from request"
}
You can use the Queria format:
database.collection.delete(identifier, {"key":"value","unique":"Unique value for callbacks, this is optional. This will also not be added to the value, don't worry."})
If you don't need the unique value for callbacks, feel free to use below:
database.collection.delete(identifier, {"key":"value"})
Or you can choose to use the JSON
format which has fields as written below.
FIELD | TYPE | DESCRIPTION |
---|---|---|
method | string | The type of request to send. |
database | string | The database to store the item. |
collection | string | The collection to store the item. |
identifier | string | The identifier name of the item to remove. |
key | string | The key name of the field to remove. |
unique | string | The unique value to return (used for getting back exact responses from the server). |
You can use the Queria format:
database.collection.delete(identifier, {"key":["key1","key2"],"value":["value1","value2"],"unique":"Unique value for callbacks, this is optional. This will also not be added to the value, don't worry."})
If you don't need the unique value for callbacks, feel free to use below:
database.collection.delete(identifier, {"key":["key1","key2"],"value":["value1","value2"]})
Or you can choose to use the JSON
format which has fields as written below.
FIELD | TYPE | DESCRIPTION |
---|---|---|
method | string | The type of request to send. |
database | string | The database to store the item. |
collection | string | The collection to store the item. |
identifier | string | The identifier name of the item to remove. |
keys | array of string | The key names of the fields to remove. |
unique | string | The unique value to return (used for getting back exact responses from the server). |
FIELD | TYPE | DESCRIPTION |
---|---|---|
response | json | Replies back with the new JSON value of the item. |
kode | integer | The server reply code (1 for success, 0 for no results, -1 for invalid request). |
replyTo | string | The unique code sent back (for callbacks). |
{
"response": "{\"id\":\"1.2\"}",
"kode": 1,
"replyTo": "Unique String"
}