Important:
Removes one or more item references from a referring field of the specified item.
Important:
Removes one or more items from a collection. The response object must contain the removed item.
function removeDataItems(
payload: RemoveDataItemsEnvelope,
): RemoveDataItemsResponse | Promise<RemoveDataItemsResponse>;
import { externalDatabase } from "@wix/data/service-plugins";
externalDatabase.provideHandlers({
removeDataItems: async (payload) => {
const { request, metadata } = payload;
// Use the `request` and `metadata` received from Wix and
// apply custom logic.
return {
// Return your response exactly as documented to integrate with Wix.
// Return value example:
results: [
{
item: {
name: "New York",
_id: "c285e77c-a86b-4361-a55f-c6b934d70187",
_owner: "facda016-24ef-4909-a90e-70687f17f658",
_createdDate: {
$date: "2021-01-02T03:04:05Z",
},
_updatedDate: {
$date: "2021-04-05T06:07:08Z",
},
},
},
],
};
},
});