DynamoDB Local trailing zeroes are not be trimmed in Map type.

0

The dynamodb local I used is the latest version, which is 2.4.0.

In dynamodb local latest, the .0 are not trimmed. It should be a bug. local

In dynamodb, the .0 is trimmed. remote

using CLI:

dynamodb local

aws dynamodb get-item \
--table-name test \
--key '{"pk":{"S":"pk"}, "sk":{"S":"sk"}}' \
--endpoint-url "http://localhost:8000"
    "Item": {
        "data": {
            "M": {
                "number": {
                    "N": "1.0"
                }
            }
        },
        "sk": {
            "S": "sk"
        },
        "pk": {
            "S": "pk"
        }
    }
}

dynamodb

aws dynamodb get-item \
--table-name remote-test \
--key '{"pk":{"S":"pk"}, "sk":{"S":"sk"}}'
{
    "Item": {
        "pk": {
            "S": "pk"
        },
        "sk": {
            "S": "sk"
        },
        "data": {
            "M": {
                "number": {
                    "N": "1"
                }
            }
        }
    }
}
L
asked 11 days ago61 views
1 Answer
0

Be sure you are on the latest version of DynamoDB local, as it behaves the same way for me:

Local

aws dynamodb get-item \
--table-name test \
--key '{"PK":{"S":"lhnng"}, "SK":{"S":"lhnng"}}' \
--endpoint-url "http://localhost:8000" 
{
    "Item": {
        "SK": {
            "S": "lhnng"
        },
        "GWP": {
            "N": "1"
        },
        "PK": {
            "S": "lhnng"
        }
    }
}

Web

aws dynamodb get-item \
--table-name test \
--key '{"PK":{"S":"lhnng"}, "SK":{"S":"lhnng"}}' 
{
    "Item": {
        "SK": {
            "S": "lhnng"
        },
        "GWP": {
            "N": "1"
        },
        "PK": {
            "S": "lhnng"
        }
    }
}
profile pictureAWS
EXPERT
answered 9 days ago
  • Hi! Thank you for your answer! But your answer has nothing to do with my question, I updated my question and attached some pictures to make it clearer

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions