Method: AWS::DynamoDB::Client#scan

Defined in:
lib/aws/dynamo_db/client.rb

#scan(options = {}) ⇒ Core::Response

Calls the Scan API operation.

Options:

  • :table_name - required - (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).

  • :attributes_to_get - (Array<String>)

  • :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 1MB 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.

  • :scan_filter - (Hash<String,Hash>) Evaluates the scan results and returns only the desired values.

    • :attribute_value_list - (Array<Hash>)

      • :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.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :comparison_operator - required - (String)

  • :exclusive_start_key - (Hash) 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.

    • :hash_key_element - required - (Hash) 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.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) 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.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

Response Structure:

  • member - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • Count - (Integer)

  • ScannedCount - (Integer)

  • LastEvaluatedKey - (Hash)

    • HashKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

    • RangeKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:

[View source]

707
# File 'lib/aws/dynamo_db/client.rb', line 707

define_client_method :scan, 'Scan'