hello, I am newcomer in Ruby. These days I develop with ruby-sdk on
aws, when I put items into dynamoDB. First I use Array putItems:
ngrid=100
putItems = Array.new(ngrid)
every element in putItems is a hash instance
putItems[i]={:latitude => str[j], :longitude => str[j+1], :u
=>str[j+2]}
I use API to put items into DynamoDB as following:
batch.put('grb2datatest2', [putItems[1],putItems[2]])
this is ok, Now, I want put all elements in array putItems into table,
but I don’t know how to write this setence, the following is obviously
wrong,
batch.put('grb2datatest2',[putItems.join(",")])
for putItems.join return a string, while the params for batch.put is:
batch.put('tablename', [hash1, hash2, hash3, ...]
batch.process!
what I need is a hash with a ‘,’ list in [], who know how program the
code?
thanks!