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
已提問 23 天前檢視次數 78 次
1 個回答
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
專家
已回答 21 天前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南