SnowPuffKing
SnowPuffKing

Reputation: 33

Changing ItemName (primary key) in SimpleDB with boto

I would like to modify ItemNames in my SimpleDB using boto. While I have been able to change attributes easily using the item['attr'] = xxxxxx, I have not been able to figure out how to change the ItemNames themselves. My failed attempt is shown below. Any guidance would be much appreciated.

connection = boto.connect_sdb(ACCESS_KEY,SECRET_KEY)
domain = connection.get_domain(domain_name)
new_unique_name = 'MyNewPrimaryKey'
item = domain.get_item('CurrentPrimaryKey')
item.name = new_unique_name
item.save

Upvotes: 1

Views: 256

Answers (1)

Ashish Pancholi
Ashish Pancholi

Reputation: 4659

You can not change the itemName(). Amazon SimpleDB simply requires a unique identifier for each row in your database. Item Name should be unique like your pk in your traditional database. You can not update the itemName(). You can delete it and again create it with your new name. Please remember, if you delete itemName()then all attribute-value pair that are associate with that itemName() will also delete.

Upvotes: 1

Related Questions