Class: AWS.DynamoDB (2011-12-05)

Inherits:
AWS.Service show all
Identifier:
dynamodb
API Version:
2011-12-05
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon DynamoDB is a fast, highly scalable, highly available, cost-effective non-relational database service.

Amazon DynamoDB removes traditional scalability limitations on data storage while maintaining low latency and predictable performance.

Sending a Request Using DynamoDB

var dynamodb = new AWS.DynamoDB();
dynamodb.batchGetItem(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the DynamoDB object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var dynamodb = new AWS.DynamoDB({apiVersion: '2011-12-05'});

You can also set the API version globally in AWS.config.apiVersions using the dynamodb service identifier:

AWS.config.apiVersions = {
  dynamodb: '2011-12-05',
  // other service API versions
};

var dynamodb = new AWS.DynamoDB();

Version:

  • 2011-12-05

Waiter Resource States

This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:

tableExists, tableNotExists

Constructor Summary

Property Summary

Properties inherited from AWS.Service

apiVersions

Method Summary

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService

Constructor Details

new AWS.DynamoDB(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a DynamoDB object

var dynamodb = new AWS.DynamoDB({apiVersion: '2011-12-05'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.DynamoDB_20111205.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.DynamoDB_20111205.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.DynamoDB_20111205.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchGetItem(params = {}, callback) ⇒ AWS.Request

Retrieves the attributes for multiple items from multiple tables using their primary keys.

The maximum number of item attributes that can be retrieved for a single operation is 100. Also, the number of items retrieved is constrained by a 1 MB the size limit. If the response size limit is exceeded or a partial result is returned due to an internal processing failure, Amazon DynamoDB returns an UnprocessedKeys value so you can retry the operation starting with the next item to get.

Amazon DynamoDB automatically adjusts the number of items returned per page to enforce this limit. For example, even if you ask to retrieve 100 items, but each individual item is 50k in size, the system returns 20 items and an appropriate UnprocessedKeys value so you can get the next page of results. If necessary, your application needs its own logic to assemble the pages of results into one set.

Service Reference:

Examples:

Calling the batchGetItem operation

var params = {
  RequestItems: { /* required */
    '<TableName>': {
      Keys: [ /* required */
        {
          HashKeyElement: { /* required */
            B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
            BS: [
              new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
              /* more items */
            ],
            N: 'STRING_VALUE',
            NS: [
              'STRING_VALUE',
              /* more items */
            ],
            S: 'STRING_VALUE',
            SS: [
              'STRING_VALUE',
              /* more items */
            ]
          },
          RangeKeyElement: {
            B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
            BS: [
              new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
              /* more items */
            ],
            N: 'STRING_VALUE',
            NS: [
              'STRING_VALUE',
              /* more items */
            ],
            S: 'STRING_VALUE',
            SS: [
              'STRING_VALUE',
              /* more items */
            ]
          }
        },
        /* more items */
      ],
      AttributesToGet: [
        'STRING_VALUE',
        /* more items */
      ],
      ConsistentRead: true || false
    },
    /* '<TableName>': ... */
  }
};
dynamodb.batchGetItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RequestItems — (map<map>)

      A map of the table name and corresponding items to get by primary key. While requesting items, each table name can be invoked only once per operation.

      • Keysrequired — (Array<map>)
        • HashKeyElementrequired — (map)

          A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

        • RangeKeyElement — (map)

          A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

      • AttributesToGet — (Array<String>)

        List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

      • ConsistentRead — (Boolean)

        If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Responses — (map<map>)

        Table names and the respective item attributes from the tables.

        • Items — (Array<map<map>>)
          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

        • ConsumedCapacityUnits — (Float)

          The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

      • UnprocessedKeys — (map<map>)

        Contains a map of tables and their respective keys that were not processed with the current response, possibly due to reaching a limit on the response size. The UnprocessedKeys value is in the same form as a RequestItems parameter (so the value can be provided directly to a subsequent BatchGetItem operation). For more information, see the above RequestItems parameter.

        • Keysrequired — (Array<map>)
          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • S — (String)

              Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

            • N — (String)

              Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

            • B — (Buffer, Typed Array, Blob, String)

              Binary attributes are sequences of unsigned bytes.

            • SS — (Array<String>)

              A set of strings.

            • NS — (Array<String>)

              A set of numbers.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A set of binary attributes.

          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • S — (String)

              Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

            • N — (String)

              Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

            • B — (Buffer, Typed Array, Blob, String)

              Binary attributes are sequences of unsigned bytes.

            • SS — (Array<String>)

              A set of strings.

            • NS — (Array<String>)

              A set of numbers.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A set of binary attributes.

        • AttributesToGet — (Array<String>)

          List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

        • ConsistentRead — (Boolean)

          If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchWriteItem(params = {}, callback) ⇒ AWS.Request

Allows to execute a batch of Put and/or Delete Requests for many tables in a single call. A total of 25 requests are allowed.

There are no transaction guarantees provided by this API. It does not allow conditional puts nor does it support return values.

Service Reference:

Examples:

Calling the batchWriteItem operation

var params = {
  RequestItems: { /* required */
    '<TableName>': [
      {
        DeleteRequest: {
          Key: { /* required */
            HashKeyElement: { /* required */
              B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
              BS: [
                new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
                /* more items */
              ],
              N: 'STRING_VALUE',
              NS: [
                'STRING_VALUE',
                /* more items */
              ],
              S: 'STRING_VALUE',
              SS: [
                'STRING_VALUE',
                /* more items */
              ]
            },
            RangeKeyElement: {
              B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
              BS: [
                new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
                /* more items */
              ],
              N: 'STRING_VALUE',
              NS: [
                'STRING_VALUE',
                /* more items */
              ],
              S: 'STRING_VALUE',
              SS: [
                'STRING_VALUE',
                /* more items */
              ]
            }
          }
        },
        PutRequest: {
          Item: { /* required */
            '<AttributeName>': {
              B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
              BS: [
                new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
                /* more items */
              ],
              N: 'STRING_VALUE',
              NS: [
                'STRING_VALUE',
                /* more items */
              ],
              S: 'STRING_VALUE',
              SS: [
                'STRING_VALUE',
                /* more items */
              ]
            },
            /* '<AttributeName>': ... */
          }
        }
      },
      /* more items */
    ],
    /* '<TableName>': ... */
  }
};
dynamodb.batchWriteItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RequestItems — (map<Array<map>>)

      A map of table name to list-of-write-requests. Used as input to the BatchWriteItem API call

      • PutRequest — (map)

        A container for a Put BatchWrite request

        • Itemrequired — (map<map>)

          The item to put

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

      • DeleteRequest — (map)

        A container for a Delete BatchWrite request

        • Keyrequired — (map)

          The item's key to be delete

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • S — (String)

              Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

            • N — (String)

              Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

            • B — (Buffer, Typed Array, Blob, String)

              Binary attributes are sequences of unsigned bytes.

            • SS — (Array<String>)

              A set of strings.

            • NS — (Array<String>)

              A set of numbers.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A set of binary attributes.

          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • S — (String)

              Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

            • N — (String)

              Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

            • B — (Buffer, Typed Array, Blob, String)

              Binary attributes are sequences of unsigned bytes.

            • SS — (Array<String>)

              A set of strings.

            • NS — (Array<String>)

              A set of numbers.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A set of binary attributes.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Responses — (map<map>)

        The response object as a result of BatchWriteItem call. This is essentially a map of table name to ConsumedCapacityUnits.

        • ConsumedCapacityUnits — (Float)

          The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

      • UnprocessedItems — (map<Array<map>>)

        The Items which we could not successfully process in a BatchWriteItem call is returned as UnprocessedItems

        • PutRequest — (map)

          A container for a Put BatchWrite request

          • Itemrequired — (map<map>)

            The item to put

            • S — (String)

              Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

            • N — (String)

              Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

            • B — (Buffer, Typed Array, Blob, String)

              Binary attributes are sequences of unsigned bytes.

            • SS — (Array<String>)

              A set of strings.

            • NS — (Array<String>)

              A set of numbers.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A set of binary attributes.

        • DeleteRequest — (map)

          A container for a Delete BatchWrite request

          • Keyrequired — (map)

            The item's key to be delete

            • HashKeyElementrequired — (map)

              A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

              • S — (String)

                Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

              • N — (String)

                Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

              • B — (Buffer, Typed Array, Blob, String)

                Binary attributes are sequences of unsigned bytes.

              • SS — (Array<String>)

                A set of strings.

              • NS — (Array<String>)

                A set of numbers.

              • BS — (Array<Buffer, Typed Array, Blob, String>)

                A set of binary attributes.

            • RangeKeyElement — (map)

              A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

              • S — (String)

                Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

              • N — (String)

                Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

              • B — (Buffer, Typed Array, Blob, String)

                Binary attributes are sequences of unsigned bytes.

              • SS — (Array<String>)

                A set of strings.

              • NS — (Array<String>)

                A set of numbers.

              • BS — (Array<Buffer, Typed Array, Blob, String>)

                A set of binary attributes.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTable(params = {}, callback) ⇒ AWS.Request

Adds a new table to your account.

The table name must be unique among those associated with the AWS Account issuing the request, and the AWS Region that receives the request (e.g. us-east-1).

The CreateTable operation triggers an asynchronous workflow to begin creating the table. Amazon DynamoDB immediately returns the state of the table (CREATING) until the table is in the ACTIVE state. Once the table is in the ACTIVE state, you can perform data plane operations.

Service Reference:

Examples:

Calling the createTable operation

var params = {
  KeySchema: { /* required */
    HashKeyElement: { /* required */
      AttributeName: 'STRING_VALUE', /* required */
      AttributeType: S | N | B /* required */
    },
    RangeKeyElement: {
      AttributeName: 'STRING_VALUE', /* required */
      AttributeType: S | N | B /* required */
    }
  },
  ProvisionedThroughput: { /* required */
    ReadCapacityUnits: 'NUMBER_VALUE', /* required */
    WriteCapacityUnits: 'NUMBER_VALUE' /* required */
  },
  TableName: 'STRING_VALUE' /* required */
};
dynamodb.createTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table you want to create. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • KeySchema — (map)

      The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • AttributeNamerequired — (String)

          The AttributeName of the KeySchemaElement.

        • AttributeTyperequired — (String)

          The AttributeType of the KeySchemaElement which can be a String or a Number.

          Possible values include:
          • "S"
          • "N"
          • "B"
      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • AttributeNamerequired — (String)

          The AttributeName of the KeySchemaElement.

        • AttributeTyperequired — (String)

          The AttributeType of the KeySchemaElement which can be a String or a Number.

          Possible values include:
          • "S"
          • "N"
          • "B"
    • ProvisionedThroughput — (map)

      Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.

      • ReadCapacityUnitsrequired — (Integer)

        ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.

      • WriteCapacityUnitsrequired — (Integer)

        WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TableDescription — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteItem(params = {}, callback) ⇒ AWS.Request

Deletes a single item in a table by primary key.

You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.

Service Reference:

Examples:

Calling the deleteItem operation

var params = {
  Key: { /* required */
    HashKeyElement: { /* required */
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    RangeKeyElement: {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  TableName: 'STRING_VALUE', /* required */
  Expected: {
    '<AttributeName>': {
      Exists: true || false,
      Value: {
        B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        BS: [
          new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          /* more items */
        ],
        N: 'STRING_VALUE',
        NS: [
          'STRING_VALUE',
          /* more items */
        ],
        S: 'STRING_VALUE',
        SS: [
          'STRING_VALUE',
          /* more items */
        ]
      }
    },
    /* '<AttributeName>': ... */
  },
  ReturnValues: NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW
};
dynamodb.deleteItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to delete an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • Key — (map)

      The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

    • Expected — (map<map>)

      Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.

      • Value — (map)

        Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Exists — (Boolean)

        Specify whether or not a value already exists for the attribute name-value pair.

    • ReturnValues — (String)

      Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.

      • NONE: Nothing is returned.
      • ALL_OLD: Returns the attributes of the item as they were before the operation.
      • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
      • ALL_NEW: Returns all the attributes and their new values after the operation.
      • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
      Possible values include:
      • "NONE"
      • "ALL_OLD"
      • "UPDATED_OLD"
      • "ALL_NEW"
      • "UPDATED_NEW"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (map<map>)

        If the ReturnValues parameter is provided as ALL_OLD in the request, Amazon DynamoDB returns an array of attribute name-value pairs (essentially, the deleted item). Otherwise, the response contains an empty set.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTable(params = {}, callback) ⇒ AWS.Request

Deletes a table and all of its items.

If the table is in the ACTIVE state, you can delete it. If a table is in CREATING or UPDATING states then Amazon DynamoDB returns a ResourceInUseException. If the specified table does not exist, Amazon DynamoDB returns a ResourceNotFoundException.

Service Reference:

Examples:

Calling the deleteTable operation

var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb.deleteTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table you want to delete. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TableDescription — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTable(params = {}, callback) ⇒ AWS.Request

Retrieves information about the table, including the current status of the table, the primary key schema and when the table was created.

If the table does not exist, Amazon DynamoDB returns a ResourceNotFoundException.

Service Reference:

Examples:

Calling the describeTable operation

var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb.describeTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

getItem(params = {}, callback) ⇒ AWS.Request

Retrieves a set of Attributes for an item that matches the primary key.

The GetItem operation provides an eventually-consistent read by default. If eventually-consistent reads are not acceptable for your application, use ConsistentRead. Although this operation might take longer than a standard read, it always returns the last updated value.

Service Reference:

Examples:

Calling the getItem operation

var params = {
  Key: { /* required */
    HashKeyElement: { /* required */
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    RangeKeyElement: {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  TableName: 'STRING_VALUE', /* required */
  AttributesToGet: [
    'STRING_VALUE',
    /* more items */
  ],
  ConsistentRead: true || false
};
dynamodb.getItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • Key — (map)

      The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

    • AttributesToGet — (Array<String>)

      List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

    • ConsistentRead — (Boolean)

      If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Item — (map<map>)

        Contains the requested attributes.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTables(params = {}, callback) ⇒ AWS.Request

Retrieves a paginated list of table names created by the AWS Account of the caller in the AWS Region (e.g. us-east-1).

Service Reference:

Examples:

Calling the listTables operation

var params = {
  ExclusiveStartTableName: 'STRING_VALUE',
  Limit: 'NUMBER_VALUE'
};
dynamodb.listTables(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ExclusiveStartTableName — (String)

      The name of the table that starts the list. If you already ran a ListTables operation and received a LastEvaluatedTableName value in the response, use that value here to continue the list.

    • Limit — (Integer)

      A number of maximum table names to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TableNames — (Array<String>)
      • LastEvaluatedTableName — (String)

        The name of the last table in the current list. Use this value as the ExclusiveStartTableName in a new request to continue the list until all the table names are returned. If this value is null, all table names have been returned.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putItem(params = {}, callback) ⇒ AWS.Request

Creates a new item, or replaces an old item with a new item (including all the attributes).

If an item already exists in the specified table with the same primary key, the new item completely replaces the existing item. You can perform a conditional put (insert a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values.

Service Reference:

Examples:

Calling the putItem operation

var params = {
  Item: { /* required */
    '<AttributeName>': {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* '<AttributeName>': ... */
  },
  TableName: 'STRING_VALUE', /* required */
  Expected: {
    '<AttributeName>': {
      Exists: true || false,
      Value: {
        B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        BS: [
          new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          /* more items */
        ],
        N: 'STRING_VALUE',
        NS: [
          'STRING_VALUE',
          /* more items */
        ],
        S: 'STRING_VALUE',
        SS: [
          'STRING_VALUE',
          /* more items */
        ]
      }
    },
    /* '<AttributeName>': ... */
  },
  ReturnValues: NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW
};
dynamodb.putItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to put an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • Item — (map<map>)

      A map of the attributes for the item, and must include the primary key values that define the item. Other attribute name-value pairs can be provided for the item.

      • S — (String)

        Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • N — (String)

        Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • B — (Buffer, Typed Array, Blob, String)

        Binary attributes are sequences of unsigned bytes.

      • SS — (Array<String>)

        A set of strings.

      • NS — (Array<String>)

        A set of numbers.

      • BS — (Array<Buffer, Typed Array, Blob, String>)

        A set of binary attributes.

    • Expected — (map<map>)

      Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.

      • Value — (map)

        Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Exists — (Boolean)

        Specify whether or not a value already exists for the attribute name-value pair.

    • ReturnValues — (String)

      Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.

      • NONE: Nothing is returned.
      • ALL_OLD: Returns the attributes of the item as they were before the operation.
      • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
      • ALL_NEW: Returns all the attributes and their new values after the operation.
      • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
      Possible values include:
      • "NONE"
      • "ALL_OLD"
      • "UPDATED_OLD"
      • "ALL_NEW"
      • "UPDATED_NEW"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (map<map>)

        Attribute values before the put operation, but only if the ReturnValues parameter is specified as ALL_OLD in the request.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

query(params = {}, callback) ⇒ AWS.Request

Gets the values of one or more items and its attributes by primary key (composite primary key, only).

Narrow the scope of the query using comparison operators on the RangeKeyValue of the composite key. Use the ScanIndexForward parameter to get results in forward or reverse order by range key.

Service Reference:

Examples:

Calling the query operation

var params = {
  HashKeyValue: { /* required */
    B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
    BS: [
      new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      /* more items */
    ],
    N: 'STRING_VALUE',
    NS: [
      'STRING_VALUE',
      /* more items */
    ],
    S: 'STRING_VALUE',
    SS: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  TableName: 'STRING_VALUE', /* required */
  AttributesToGet: [
    'STRING_VALUE',
    /* more items */
  ],
  ConsistentRead: true || false,
  Count: true || false,
  ExclusiveStartKey: {
    HashKeyElement: { /* required */
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    RangeKeyElement: {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Limit: 'NUMBER_VALUE',
  RangeKeyCondition: {
    ComparisonOperator: EQ | NE | IN | LE | LT | GE | GT | BETWEEN | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH, /* required */
    AttributeValueList: [
      {
        B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        BS: [
          new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          /* more items */
        ],
        N: 'STRING_VALUE',
        NS: [
          'STRING_VALUE',
          /* more items */
        ],
        S: 'STRING_VALUE',
        SS: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  ScanIndexForward: true || false
};
dynamodb.query(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to query. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • AttributesToGet — (Array<String>)

      List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

    • Limit — (Integer)

      The maximum number of items to return. If Amazon DynamoDB hits this limit while querying the table, it stops the query and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the query and returns the matching values, and a LastEvaluatedKey to apply in a subsequent operation to continue the query.

    • ConsistentRead — (Boolean)

      If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

    • Count — (Boolean)

      If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.

    • HashKeyValue — (map)

      Attribute value of the hash component of the composite primary key.

      • S — (String)

        Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • N — (String)

        Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • B — (Buffer, Typed Array, Blob, String)

        Binary attributes are sequences of unsigned bytes.

      • SS — (Array<String>)

        A set of strings.

      • NS — (Array<String>)

        A set of numbers.

      • BS — (Array<Buffer, Typed Array, Blob, String>)

        A set of binary attributes.

    • RangeKeyCondition — (map)

      A container for the attribute values and comparison operators to use for the query.

      • AttributeValueList — (Array<map>)

        A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ComparisonOperatorrequired — (String)

        A comparison operator is an enumeration of several operations:

        • EQ for equal.
        • NE for not equal.
        • IN checks for exact matches.
        • LE for less than or equal to.
        • LT for less than.
        • GE for greater than or equal to.
        • GT for greater than.
        • BETWEEN for between.
        • NOT_NULL for exists.
        • NULL for not exists.
        • CONTAINS for substring or value in a set.
        • NOT_CONTAINS for absence of a substring or absence of a value in a set.
        • BEGINS_WITH for a substring prefix.

        Scan operations support all available comparison operators.

        Query operations support a subset of the available comparison operators: EQ, LE, LT, GE, GT, BETWEEN, and BEGINS_WITH.

        Possible values include:
        • "EQ"
        • "NE"
        • "IN"
        • "LE"
        • "LT"
        • "GE"
        • "GT"
        • "BETWEEN"
        • "NOT_NULL"
        • "NULL"
        • "CONTAINS"
        • "NOT_CONTAINS"
        • "BEGINS_WITH"
    • ScanIndexForward — (Boolean)

      Specifies forward or backward traversal of the index. Amazon DynamoDB returns results reflecting the requested order, determined by the range key. The default value is true (forward).

    • ExclusiveStartKey — (map)

      Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the LastEvaluatedKey if that query operation was interrupted before completing the query; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new query request to continue the operation from that point.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Items — (Array<map<map>>)
        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Count — (Integer)

        Number of items in the response.

      • LastEvaluatedKey — (map)

        Primary key of the item where the query operation stopped, inclusive of the previous result set. Use this value to start a new operation excluding this value in the new request. The LastEvaluatedKey is null when the entire query result set is complete (i.e. the operation processed the "last page").

        • HashKeyElementrequired — (map)

          A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

        • RangeKeyElement — (map)

          A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

scan(params = {}, callback) ⇒ AWS.Request

Retrieves one or more items and its attributes by performing a full scan of a table.

Provide a ScanFilter to get more specific results.

Service Reference:

Examples:

Calling the scan operation

var params = {
  TableName: 'STRING_VALUE', /* required */
  AttributesToGet: [
    'STRING_VALUE',
    /* more items */
  ],
  Count: true || false,
  ExclusiveStartKey: {
    HashKeyElement: { /* required */
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    RangeKeyElement: {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Limit: 'NUMBER_VALUE',
  ScanFilter: {
    '<String>': {
      ComparisonOperator: EQ | NE | IN | LE | LT | GE | GT | BETWEEN | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH, /* required */
      AttributeValueList: [
        {
          B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          BS: [
            new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
            /* more items */
          ],
          N: 'STRING_VALUE',
          NS: [
            'STRING_VALUE',
            /* more items */
          ],
          S: 'STRING_VALUE',
          SS: [
            'STRING_VALUE',
            /* more items */
          ]
        },
        /* more items */
      ]
    },
    /* '<String>': ... */
  }
};
dynamodb.scan(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to scan. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • AttributesToGet — (Array<String>)

      List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

    • Limit — (Integer)

      The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1 MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan.

    • Count — (Boolean)

      If set to true, Amazon DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.

    • ScanFilter — (map<map>)

      Evaluates the scan results and returns only the desired values.

      • AttributeValueList — (Array<map>)

        A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ComparisonOperatorrequired — (String)

        A comparison operator is an enumeration of several operations:

        • EQ for equal.
        • NE for not equal.
        • IN checks for exact matches.
        • LE for less than or equal to.
        • LT for less than.
        • GE for greater than or equal to.
        • GT for greater than.
        • BETWEEN for between.
        • NOT_NULL for exists.
        • NULL for not exists.
        • CONTAINS for substring or value in a set.
        • NOT_CONTAINS for absence of a substring or absence of a value in a set.
        • BEGINS_WITH for a substring prefix.

        Scan operations support all available comparison operators.

        Query operations support a subset of the available comparison operators: EQ, LE, LT, GE, GT, BETWEEN, and BEGINS_WITH.

        Possible values include:
        • "EQ"
        • "NE"
        • "IN"
        • "LE"
        • "LT"
        • "GE"
        • "GT"
        • "BETWEEN"
        • "NOT_NULL"
        • "NULL"
        • "CONTAINS"
        • "NOT_CONTAINS"
        • "BEGINS_WITH"
    • ExclusiveStartKey — (map)

      Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new scan request to continue the operation from that point.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Items — (Array<map<map>>)
        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Count — (Integer)

        Number of items in the response.

      • ScannedCount — (Integer)

        Number of items in the complete scan before any filters are applied. A high ScannedCount value with few, or no, Count results indicates an inefficient Scan operation.

      • LastEvaluatedKey — (map)

        Primary key of the item where the scan operation stopped. Provide this value in a subsequent scan operation to continue the operation from that point. The LastEvaluatedKey is null when the entire scan result set is complete (i.e. the operation processed the "last page").

        • HashKeyElementrequired — (map)

          A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

        • RangeKeyElement — (map)

          A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

          • S — (String)

            Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • N — (String)

            Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • B — (Buffer, Typed Array, Blob, String)

            Binary attributes are sequences of unsigned bytes.

          • SS — (Array<String>)

            A set of strings.

          • NS — (Array<String>)

            A set of numbers.

          • BS — (Array<Buffer, Typed Array, Blob, String>)

            A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateItem(params = {}, callback) ⇒ AWS.Request

Edits an existing item's attributes.

You can perform a conditional update (insert a new attribute name-value pair if it doesn't exist, or replace an existing name-value pair if it has certain expected attribute values).

Service Reference:

Examples:

Calling the updateItem operation

var params = {
  AttributeUpdates: { /* required */
    '<AttributeName>': {
      Action: ADD | PUT | DELETE,
      Value: {
        B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        BS: [
          new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          /* more items */
        ],
        N: 'STRING_VALUE',
        NS: [
          'STRING_VALUE',
          /* more items */
        ],
        S: 'STRING_VALUE',
        SS: [
          'STRING_VALUE',
          /* more items */
        ]
      }
    },
    /* '<AttributeName>': ... */
  },
  Key: { /* required */
    HashKeyElement: { /* required */
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    RangeKeyElement: {
      B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      BS: [
        new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        /* more items */
      ],
      N: 'STRING_VALUE',
      NS: [
        'STRING_VALUE',
        /* more items */
      ],
      S: 'STRING_VALUE',
      SS: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  TableName: 'STRING_VALUE', /* required */
  Expected: {
    '<AttributeName>': {
      Exists: true || false,
      Value: {
        B: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        BS: [
          new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          /* more items */
        ],
        N: 'STRING_VALUE',
        NS: [
          'STRING_VALUE',
          /* more items */
        ],
        S: 'STRING_VALUE',
        SS: [
          'STRING_VALUE',
          /* more items */
        ]
      }
    },
    /* '<AttributeName>': ... */
  },
  ReturnValues: NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW
};
dynamodb.updateItem(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table in which you want to update an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • Key — (map)

      The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

      • HashKeyElementrequired — (map)

        A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • RangeKeyElement — (map)

        A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

    • AttributeUpdates — (map<map>)

      Map of attribute name to the new value and action for the update. The attribute names specify the attributes to modify, and cannot contain any primary key attributes.

      • Value — (map)

        AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Action — (String)

        The type of action for an item update operation. Only use the add action for numbers or sets; the specified value is added to the existing value. If a set of values is specified, the values are added to the existing set. Adds the specified attribute. If the attribute exists, it is replaced by the new value. If no value is specified, this removes the attribute and its value. If a set of values is specified, then the values in the specified set are removed from the old set.

        Possible values include:
        • "ADD"
        • "PUT"
        • "DELETE"
    • Expected — (map<map>)

      Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.

      • Value — (map)

        Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • Exists — (Boolean)

        Specify whether or not a value already exists for the attribute name-value pair.

    • ReturnValues — (String)

      Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.

      • NONE: Nothing is returned.
      • ALL_OLD: Returns the attributes of the item as they were before the operation.
      • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
      • ALL_NEW: Returns all the attributes and their new values after the operation.
      • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
      Possible values include:
      • "NONE"
      • "ALL_OLD"
      • "UPDATED_OLD"
      • "ALL_NEW"
      • "UPDATED_NEW"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (map<map>)

        A map of attribute name-value pairs, but only if the ReturnValues parameter is specified as something other than NONE in the request.

        • S — (String)

          Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • N — (String)

          Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • B — (Buffer, Typed Array, Blob, String)

          Binary attributes are sequences of unsigned bytes.

        • SS — (Array<String>)

          A set of strings.

        • NS — (Array<String>)

          A set of numbers.

        • BS — (Array<Buffer, Typed Array, Blob, String>)

          A set of binary attributes.

      • ConsumedCapacityUnits — (Float)

        The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateTable(params = {}, callback) ⇒ AWS.Request

Updates the provisioned throughput for the given table.

Setting the throughput for a table helps you manage performance and is part of the Provisioned Throughput feature of Amazon DynamoDB.

Service Reference:

Examples:

Calling the updateTable operation

var params = {
  ProvisionedThroughput: { /* required */
    ReadCapacityUnits: 'NUMBER_VALUE', /* required */
    WriteCapacityUnits: 'NUMBER_VALUE' /* required */
  },
  TableName: 'STRING_VALUE' /* required */
};
dynamodb.updateTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      The name of the table you want to update. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

    • ProvisionedThroughput — (map)

      Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.

      • ReadCapacityUnitsrequired — (Integer)

        ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.

      • WriteCapacityUnitsrequired — (Integer)

        WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TableDescription — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

waitFor(state, params = {}, callback) ⇒ AWS.Request

Waits for a given DynamoDB_20111205 resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.

Examples:

Waiting for the tableExists state

var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb_20111205.waitFor('tableExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • state (String)

    the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.

  • params (map) (defaults to: {})

    a list of parameters for the given state. See each waiter resource state for required parameters.

Callback (callback):

  • function(err, data) { ... }

    Callback containing error and data information. See the respective resource state for the expected error or data information.

    If the waiter times out its requests, it will return a ResourceNotReady error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

Waiter Resource Details

dynamodb.waitFor('tableExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the tableExists state by periodically calling the underlying DynamoDB_20111205.describeTable() operation every 20 seconds (at most 25 times).

Examples:

Waiting for the tableExists state

var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb_20111205.waitFor('tableExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • TableName — (String)

      The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

dynamodb.waitFor('tableNotExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the tableNotExists state by periodically calling the underlying DynamoDB_20111205.describeTable() operation every 20 seconds (at most 25 times).

Examples:

Waiting for the tableNotExists state

var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb_20111205.waitFor('tableNotExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • TableName — (String)

      The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)
        • TableName — (String)

          The name of the table being described.

        • KeySchema — (map)

          The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.

          • HashKeyElementrequired — (map)

            A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
          • RangeKeyElement — (map)

            A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

            • AttributeNamerequired — (String)

              The AttributeName of the KeySchemaElement.

            • AttributeTyperequired — (String)

              The AttributeType of the KeySchemaElement which can be a String or a Number.

              Possible values include:
              • "S"
              • "N"
              • "B"
        • TableStatus — (String) Possible values include:
          • "CREATING"
          • "UPDATING"
          • "DELETING"
          • "ACTIVE"
        • CreationDateTime — (Date)
        • ProvisionedThroughput — (map)
          • LastIncreaseDateTime — (Date)
          • LastDecreaseDateTime — (Date)
          • NumberOfDecreasesToday — (Integer)
          • ReadCapacityUnits — (Integer)
          • WriteCapacityUnits — (Integer)
        • TableSizeBytes — (Integer)
        • ItemCount — (Integer)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also: