Table functions
Find Rows
This function helps to find some rows with specific conditions, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user. Find functions accept some options:
curl --location --request PUT 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "conditions": {}, "sorts": {}, "joins": [], "select": [] }'
Inputs:
Sorts: This params is a json object contains fields and order of them. example:
{
"field": "asc / desc"
}
- Ignore the sorts field if you dont pass anything to it.
Joins: This params is a json array contains join objects. example:
[
{
"table": "table_id", // ID of the joined table
"localField": "field", // Key field in current table
"foreignField": "field" // Key field to match from joined table with localField
}
]
- Ignore the field if you dont have any conditions.
Conditions: This params is a json object contains conditions. example:
{
"op": "= / != / > / < / >= / <= / LIKE / AND / OR", // the operation of the condition
"field": "field", // field to do operation on, it should be empty if operation is AND or OR
"value": "value", // the value to compire
"values": [], // the array value to compire if opeation support, like: = / != ...
"list": [ ... sub conditions ] // the sub conditions if the operation is AND / OR
}
Select: This params is a json array contains fields that you want to get. example:
[ "field1", "field2" ]
- Ignore the field if you dont have any selection, so it will return all fields.
Find Row By ID
this function return a row with specific id, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/[ROW_ID]' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
Find Row By ID Then Update
this function update a row with specific id and will return the last values of it, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.
curl --location --request PUT 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/[ROW_ID]' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "data": {} }'
Find Row By ID Then Delete
this function deletes a row with specific id and will return the last values of it, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.
curl --location --request DELELTE 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/[ROW_ID]' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
Insert New Row
this function inserts a new row with passed data and return new created row.
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "data": {} }'
Insert Many Rows
this function inserts multiple rows with passed data and returns new created rows.
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/insert' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "data": [] }'
Update many Rows
you can update multiple rows with specific condition with this function.
curl --location --request PUT 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/update' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "condition": {}, "data": {} }'
Delete Row By ID
this function deletes a row with an specific id
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/delete' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "condition": {} }'
Delete Many Rows
this function deletes multiple rows with specific condition
curl --location --request PUT 'https://link.dynamicpixels.dev/game/[CLIENT ID]/server/services/table/[TABLE_ID]/delete' \
--header 'Authorization: Bearer [PUT ACCESS TOKEN HERE]'
--data '{ "condition": {} }'