AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Converts a dictionary of DynamoDB attribute values to a dictionary of types commonly used in PowerShell.

Syntax

ConvertFrom-DDBItem
-InputObject <Dictionary`2[]>
-NumericType <Type>

Description

Converts a dictionary of DynamoDB attribute values to a dictionary of types commonly used in PowerShell.

Parameters

-InputObject <Dictionary`2[]>
A dictionary of DynamoDB attribute values to convert to a Hashtable of types commonly used in PowerShell. The following DynamoDB attribute values will be converted to the following types:
  • S will be converted to String.
  • BOOL will be converted to Boolean.
  • N will be converted to the type specified by the NumericType parameter.
  • B will be converted to MemoryStream.
  • M will be converted to Hashtable.
  • SS will be converted to HashSet<String>.
  • NS will be converted to a HashSet of the type specified by the parameter NumericType.
  • BS will be converted to HashSet<MemoryStream>.
  • L will be converted to Array.
Required?False
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
AliasesItem, Items, Attributes, UnprocessedItems
-NumericType <Type>
Specifies the type to which numeric values will be converted. This conversion is required because DynamoDB stores numeric values as strings. The default value for this parameter is Double. There is a risk for loss of precision when converting to Single or Double because these types do not support up to 38 digits of precision as DynamoDB numeric values do.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Outputs

System.Collections.HashTable
This cmdlet returns a dictionary of common types.

Examples

Example 1

@{
SongTitle = 'Somewhere Down The Road'
Artist = 'No One You Know'
} | ConvertTo-DDBItem

Get-DDBItem -TableName 'Music' -Key $key | ConvertFrom-DDBItem

Name Value
---- -----
Genre Country
Artist No One You Know
Price 1.94
CriticRating 9
SongTitle Somewhere Down The Road
AlbumTitle Somewhat Famous
ConvertFrom-DDBItem is used to convert the result of Get-DDBItem from a hashtable of DynamoDB AttributeValues to a hashtable of common types like string and double.

Supported Version

AWS Tools for PowerShell: 2.x.y.z