Page tree
Skip to end of metadata
Go to start of metadata

CAST supports DynamoDB via its Node.js extension. Details about how this support is provided for Node.js source code is discussed below.

Objects

IconDescription

Node.js DynamoDB Endpoint

Node.jsDynamoDB Table

Links

APILink TypeFunction







DynamoDB

No Link
  • createGlobalTable

  • createTable

useSelectLink
  • createBackup
  • getItem

  • batchGetItem

  • transactWriteItems

  • batchWriteItem

  • restoreTableToPointInTime
useDeleteLink
  • deleteTable

  • deleteItem

  • transactWriteItems

  • batchWriteItem

useUpdateLink
  • transactWriteItems

  • batchWriteItem

  • updateItem

  • updateTable

  • putItem
  • restoreTableToPointInTime
  • restoreTableFromBackup






DocumentClient

useSelectLink
  • batchGet
  • transactGet
  • get
  • scan
  • query
  • batchWrite
  • transactWrite
useDeleteLink
  • batchWrite
  • transactWrite
  • delete
useUpdateLink
  • put
  • update
  • batchWrite
  • transactWrite

Code samples

These declaration will establish a connection to the database located on localhost

var AWS = require("aws-sdk");

AWS.config.update({
  region: "us-west-2",
  endpoint: "http://localhost:8000"
});

var dynamodb = new AWS.DynamoDB();

These declarations will create a useUpdateLink from code to the database "myDatabase".

/* This example adds a new item to the Music table. */

var params = {
  Item: {
    "AlbumTitle": {
      S: "Somewhat Famous"
    }, 
    "Artist": {
      S: "No One You Know"
    }, 
    "SongTitle": {
      S: "Call Me Today"
    }
  }, 
  ReturnConsumedCapacity: "TOTAL", 
  TableName: "Music"
};
dynamodb.putItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

What results can you expect?

Once the analysis/snapshot generation has completed, you can view the results in the normal manner (for example via CAST Enlighten):

Analysis of the last code sample

  • No labels