Search.../

Remove Item

Remove an item from a collection.

Syntax

function RemoveItem(collectionName: string, itemId: string, requestContext: _com_wixpress_cloud_externaldb_api_RequestContext): Remove<_com_wixpress_cloud_externaldb_api_RemoveResponse>

Remove Item Parameters

NAME
TYPE
DESCRIPTION
collectionName
string

The collection or table to delete from.

itemId
string

The _id of the item to be deleted.

requestContext
_com_wixpress_cloud_externaldb_api_RequestContext

The request context object.

Returns

Status/Error Codes:
404 - Item not found

Return Type:

_com_wixpress_cloud_externaldb_api_RemoveResponse
NAME
TYPE
DESCRIPTION
item
struct

An object containing the deleted item.

Was this helpful?

Delete an item from a collection.

Request

curl

Copy Code
1curl --X POST 'https://mysql-adapter.com/data/remove' \
2--header 'Content-Type: application/json' \
3--data-raw '{
4 "requestContext": {
5 "settings": {
6 "secretKey": "mySecureSecret"
7 },
8 "instanceId": "12a345b6-7890-98d7-65e4-f321abc1de23",
9 "installationId": "987fe654-3d21-4def-ab5c-6d78e90f123a",
10 "memberId": "77aa88bb-2c2c-d3d3-4e4e-ff55aa66bb77",
11 "role": "OWNER"
12 "collectionName": "car",
13 "itemId": "12345678-abcd-9876-fedc-a9876543210"
14}'

Response

json

1
2{"item": {
3 "_id": "12345678-abcd-9876-fedc-a9876543210",
4 "_owner": "77aa88bb-2c2c-d3d3-4e4e-ff55aa66bb77",
5 "make": "BMW",
6 "model": "i8",
7 "year": 2020,
8 "date_added": {"$date": "2020-01-01T21:00:00.000Z"}
9}}