lib/dynamoid/adapter_plugin/aws_sdk_v2.rb
# Removes an item from DynamoDB.
#
# @param [String] table_name the name of the table
# @param [String] key the hash key of the item to delete
# @param [Hash] options provide a range key here if the table has a composite key
#
# @since 1.0.0
#
# @todo: Provide support for various options http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#delete_item-instance_method
Removes an item from DynamoDB.
Removes an item from DynamoDB .
def delete_item(table_name, key, options = {})
        range_key = options[:range_key]
        conditions = options[:conditions]
        table = describe_table(table_name)
        client.delete_item(
          table_name: table_name,
          key: key_stanza(table, key, range_key),
          expected: expected_stanza(conditions)
        )
      rescue Aws::DynamoDB::Errors::ConditionalCheckFailedException => e
        raise Dynamoid::Errors::ConditionalCheckFailedException, e
      end
def delete_item ( table_name , key , options = { } ) range_key = options [ :range_key ] conditions = options [ :conditions ] table = describe_table ( table_name ) client . delete_item ( table_name : table_name , key : key_stanza ( table , key , range_key ) , expected : expected_stanza ( conditions ) ) rescue Aws :: DynamoDB :: Errors :: ConditionalCheckFailedException => e raise Dynamoid :: Errors :: ConditionalCheckFailedException , e end
Removes an item from DynamoDB.
Removes an item from DynamoDB .
table_name
key
options
options provide a range key here if the table has a composite key
options provide a range key here if the table has a composite key
since
None
todo:
None