Boto dynamodb batch_write and delete_item - 'The provided key element does not match the scheme'

I am trying to delete a large number of elements in a DynamoDB table using boto and python. My table is configured using a primary key as a device identifier (e.g. MAC address). There are several entries for each device identifier in the table because the secondary key is a UNIX timestamp.

From my reading this code should work:

from boto.dynamodb2.table import Table

def delete_batch(self, guid):    
    table = Table('Integers')

    with table.batch_write() as batch:
        batch.delete_item(Id=guid)

Source: http://docs.pythonboto.org/en/latest/dynamodb2_tut.html#batch-writing

However, it returns "The provided key element does not match the schema" as an error message.

I suspect the problem is that guid is not unique in my table.

, ?

+4
1

- , ( + ) - .

DynamoDB - ( , Query )

Steffen

+7

Source: https://habr.com/ru/post/1527224/


All Articles