请教数组hash对象
下面这段程序中,我用batch.put向DynamoDB中导入数组中的hash对象
ngrid=100
putItems = Array.new(ngrid)
...
putItems[i]={:latitude => str[j], :longitude => str[j+1], :u=>str[j+2]}
...
batch.put('grb2datatest2', [putItems[1],putItems[2]])
这样完全没有问题,我想将整个数组中的hash对象导入,于是我写了这一句
batch.put('grb2datatest2',[putItems.join(",")])
当然是错误的,因为这将数组元素转成了字符串,而batch.put需要是的用逗号分开的哈希对象,如下
batch.put('tablename', [hash1, hash2, hash3, ...]
那我怎么从数组得到用,逗号分开的hash对象写在上面的[]中?谢谢!!