Method: Dynamini::TestClient#update_item

Defined in:
lib/dynamini/test_client.rb

#update_item(args = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dynamini/test_client.rb', line 21

def update_item(args = {})
  table = get_table(args[:table_name])

  keys = args[:key]

  hash_key_value = keys[hash_key_attr]
  range_key_value = keys[range_key_attr]

  updates = flatten_attribute_updates(args).merge(
      hash_key_attr => hash_key_value
  )

  primary_index_insertion(hash_key_value, range_key_value, updates, table) if hash_key_value
end