totemstech / node-dynamodb

DynamoDb Driver for Node.js
MIT License
202 stars 48 forks source link

PUT list of dicts #49

Open Katafalkas opened 9 years ago

Katafalkas commented 9 years ago

Hey,

According to http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html it should be possible to PUT a list of dicts to data store. Currently it does not seem to work for me:

var item = { one: 'test2',
               two: 'Kapow',
               usr: 'spolu',
               lng: ['node', 'c++'],
               mew: [
                 {'foo': 'blue', 'w': 1, 't': 2},
                 {'foo': 'red', 'w': 11, 't': 22}
               ]
  };

ddb.putItem('foobar', item, {}, function(err, res, cap) {});

i get the error:

ERR { [Error: PutItem [400]: One or more parameter values were invalid: An number set  may not be empty]

  statusCode: 400,

  requestId: 'MUFRMIPBFI6VVAR1R408KLGS0RVV4KQNSO5AEMVJF66Q9ASUAAJG',

  code: 'ValidationException',

  data: 

   { __type: 'com.amazon.coral.validate#ValidationException',

     message: 'One or more parameter values were invalid: An number set  may not be empty' } }

This is duplicate question from google groups that I posted.

spolu commented 9 years ago

Hi @Katafalkas we're unfortunately not maintaining that repo currently. DynamoDB did change their APIs recently. Maybe you can issue a PR?

ejames17 commented 9 years ago

Hi @Katafalkas how did you resolve this issue? Im currently facing the same thing