DeleteItem

POST v1/data/{project_id}/tables/{table_name}/delete_item

Request Syntax

{
    "key": {
        "string": {
            "B": "blob",
            "BS": [
                "blob"
            ],
            "N": "string",
            "NS": [
                "string"
            ],
            "S": "string",
            "SS": [
                "string"
            ]
        }
    },
    "expected": {
        "string": {
            "exists": "boolean",
            "value": {
                "B": "blob",
                "BS": [
                    "blob"
                ],
                "N": "string",
                "NS": [
                    "string"
                ],
                "S": "string",
                "SS": [
                    "string"
                ]
            }
        }
    },
    "return_values": "string"
}

Request Parameters

key
Primary key of the item to delete.
Type: String to object map
Required: Yes
expected
The conditional block for the DeleteItem operation. All the conditions must be met for the operation to succeed.
Type: String to object map
Required: No
return_values
Type: String
Valid values: NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW
Required: No

Response Syntax

{
    "attributes": {
        "string": {
            "B": "blob",
            "BS": [
                "blob"
            ],
            "N": "string",
            "NS": [
                "string"
            ],
            "S": "string",
            "SS": [
                "string"
            ]
        }
    }
}

Response Elements

attributes
Item attributes
Type: String to Attributevalue object map

Errors

BackendInteractionException
ClusterIsNotConnectedException
ConditionalCheckFailedException
ValidationError

Sample Request

{
    "key": {
        "ForumName": {
            "S": "MagnetoDB"
        },
        "Subject": {
            "S": "How do I delete an item?"
        }
    },
    "expected": {
        "Subject": {
            "value": {
                "S": "How do I delete an item?"
            }
        },
        "Replies": {
            "exists": false
        }
    },
    "returnValues": "ALL_OLD"
}

Sample Response

{
    "attributes": {
        "LastPostDateTime": {
            "S": "201303190422"
        },
        "ForumName": {
            "S": "MagnetoDB"
        },
        "Message": {
            "S": "I want to delete item."
        },
        "Subject": {
            "S": "How do I delete an item?"
        },
        "LastPostedBy": {
            "S": "fred@example.com"
        }
    }
}