aws sdk - GetItem with DynamoDB via AWS SDK Javascript -


i've written following code using dynamodb:

var qryitem = {     tablename: 'mytable',     key: {         userid: {             s: '1234567'         }     } };  dynamodb.getitem(qryitem, function (error, data) {     console.log(data);     if(error){         console.log(error, error.stack);     } }); 

the table mytable has following attributes:

  • userid (string) primary partition key
  • name (string) primary sort key
  • email (string)

i've executed scan operation, when execute getitem request above, following error returned:

validationexception: provided key element not match schema

any advice appreciated.

so yeah, always, read documentation thoroughly before passing go.

i specified "sort key" when created table , must pass in when perform query , must populated in order validation schema clear.

so query parameters should like:

var qryitem = {     tablename: 'mytable',     key: {         userid: {             s: '1234567'         },         name: {             s: 'john citizen'         }     } }; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -