A lightweight tool to convert between DynamoDB JSON format and normal JSON.
1.4K
A lightweight tool to convert between DynamoDB JSON format and normal JSON.
Command: ddb_convert [OPTIONS] <MODE>
Arguments:
<MODE> - Conversion mode:
from-ddb - Convert DynamoDB JSON to normal JSONto-ddb - Convert normal JSON to DynamoDB JSONOptions:
-i, --input <INPUT> - Input file (stdin if not specified)-o, --output <OUTPUT> - Output file (stdout if not specified)-p, --pretty - Pretty print output JSON--without-item - Omit top-level "Item" wrapper (only applies to to-ddb
mode)-h, --help - Print help-V, --version - Print versionCommand:
echo '{"name":"Alice","age":30}' | docker run --rm -i olpa/ddb_convert to-ddb
Output:
{"Item":{"name":{"S":"Alice"},"age":{"N":"30"}}}
Convert from DynamoDB format (using file mount)
Input file data.json:
{"Item":{"name":{"S":"Alice"},"age":{"N":"30"}}}
When working with files, mount your working directory to /data. Command:
docker run --rm -v $(pwd):/data olpa/ddb_convert from-ddb -i data.json
Output:
{"name":"Alice","age":30}
Available at: https://github.com/olpa/streaming_json/tree/master/examples/dynamodb
Content type
Image
Digest
sha256:df1cc4c4e…
Size
556.2 kB
Last updated
9 months ago
docker pull olpa/ddb_convert