Skip to main content
Version: SDK-5.11.6

DeleteData

public BackendReturnObject DeleteMyLatestData(string tableName);
public BackendReturnObject DeleteMyData(string tableName, string inDate);
public BackendReturnObject DeleteOtherData(string tableName, string inDate, string owner_inDate);

Parameters

ValueTypeDescription
tableNamestringTable name of the game information to be deleted
inDatestringinDate value of the row to be deleted
owner_inDatestringinDate of the user who owns the row

Description

DeleteMyLatestData method deletes a piece of my data that has been registered most recently in the table.
DeleteMyData method deletes a piece of my data in the table identical to inDate.
DeleteOtherData method deletes a piece of my data in the table identical to inDate and owner_inDate. (If public, the data of others can also be deleted.)

  • The data can be deleted regardless of their schema definition statuses.
  • You can only delete your own public/private data.
  • You can delete the public data of others.
  • You cannot delete the private data of others. You can import your owner_inDate via { Backend.UserInDate }.

Example

Synchronous

// Delete my data that has been registered most recently in the table
Backend.PlayerData.DeleteMyLatestData("tableName");

// Delete my data in the table that is identical to inDate
Backend.PlayerData.DeleteMyData("tableName", "2023-10-25:11:34:24.124Z");

// Delete data in the table identical to inDate and owner_inDate (data of others can also be deleted)

Backend.PlayerData.DeleteOtherData("tableName", "2023-10-25:11:34:24.124Z", "2023-10-22:09:14:35.616Z");

Asynchronous

// Delete my data that has been registered most recently in the table
Backend.PlayerData.DeleteMyLatestData("tableName", (callback) =>
{
// Post-process
});

// Delete data in the table that is identical to inDate
Backend.PlayerData.DeleteMyData("tableName", "2023-10-25:11:34:24.124Z", (callback) =>
{
// Post-process
});

// Delete data in the table identical to inDate and owner_inDate (data of others can also be deleted)
Backend.PlayerData.DeleteOtherData("tableName", "2023-10-25:11:34:24.124Z", "2023-10-22:09:14:35.616Z", (callback) =>
{
// Post-process
});

SendQueue

// Delete my data that has been registered most recently in the table
SendQueue.Enqueue(Backend.PlayerData.DeleteMyLatestData, "tableName", (callback) =>
{
// Post-process
});

// Delete data in the table that is identical to inDate
SendQueue.Enqueue(Backend.PlayerData.DeleteMyData, "tableName", "2023-10-25:11:34:24.124Z", (callback) =>
{
// Post-process
});

// Delete data in the table identical to inDate and owner_inDate (data of others can also be deleted)
SendQueue.Enqueue(BackendBackend.PlayerData.DeleteOtherData, "tableName", "2023-10-25:11:34:24.124Z", "2023-10-22:09:14:35.616Z", (callback) =>
{
// Post-process
});

ReturnCase

Success cases

When the lookup is successful
statusCode : 200
message : Success
returnValue : {"ConsumedCapacity":{"Write":{"CapacityUnits":{Read capacity}}}} Example: {"ConsumedCapacity":{"Write":{"CapacityUnits":3}}}

Error cases

When it was owner_inDate of a user that does not exist statusCode : 400
errorCode : BadParameterException
message : bad owner_inDate, Invalid owner_inDate

When the user tries to delete the information of others' private table
statusCode : 403
errorCode : ForbiddenException
message : Forbidden Private table can only be modified by the owner, Private table can only be modified by the owner

When the user tries to delete a non-existent row
statusCode : 404
errorCode : NotFoundException
message : gameInfo not found, gameInfo cannot be found

When the user tries to delete a non-existent table
statusCode : 404
errorCode : NotFoundException
message : table not found, table cannot be found

When an attempt is made to delete an inactive table
statusCode : 412
errorCode : PreconditionFailed
message : inactiveTable prerequisites are not met