Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get a record in dynamodb nodejs

// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set the region 
AWS.config.update({region: 'REGION'});

// Create the DynamoDB service object
var ddb = new AWS.DynamoDB({apiVersion: '2012-08-10'});

var params = {
  TableName: 'TABLE',
  Key: {
    'KEY_NAME': {N: '001'}
  },
  ProjectionExpression: 'ATTRIBUTE_NAME'
};

// Call DynamoDB to read the item from the table
ddb.getItem(params, function(err, data) {
  if (err) {
    console.log("Error", err);
  } else {
    console.log("Success", data.Item);
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: express js boilerplate 
Javascript :: javascript object tostring 
Javascript :: angular {{}} new line 
Javascript :: react native copy to clipboard 
Javascript :: js calculate date difference 
Javascript :: [Error - 10:52:45 PM] Failed to load jshint library 
Javascript :: ngmodel angular 
Javascript :: string contains substring javascript 
Javascript :: search in string array javascript 
Javascript :: discord.js remove reaction 
Javascript :: libraries like html-react-parser 
Javascript :: check if document is ready js 
Javascript :: promise in forloop 
Javascript :: esversion 9 
Javascript :: jsx render array 
Javascript :: foreach object javascript 
Javascript :: npm stylelint 
Javascript :: react router dom current path hook 
Javascript :: get data from url in angular 
Javascript :: convert file to blob javascript 
Javascript :: object key map javascript 
Javascript :: js random numbers 
Javascript :: js for in 10 
Javascript :: jquery ajax get response code 
Javascript :: bootbox js confirmation 
Javascript :: jquery check if class exists 
Javascript :: javascript check if variable is object 
Javascript :: mongodb connection string node example localhost 
Javascript :: is var is not blank then display value in javascript 
Javascript :: js validate phone number 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =