DyanmoDb is storing value 1 instead of boolean value true

前端 未结 2 2052
一整个雨季
一整个雨季 2021-02-13 17:42

I have a method which is simply storing flag value true for a particular record. My flag attribute has been defined as Boolean which has value true/false in my DynamoDB database

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-13 17:55

    DynamoDb will store the boolean value as 0 or 1 by default.

    Use the following decorators to save the attribute as false or true respectively.

    @DynamoDBTyped(DynamoDBAttributeType.BOOL)
    @DynamoDBAttribute
    private boolean notificationFlag;
    

    Note: @DynamoDBNativeBoolean which used to do this is deprecated

提交回复
热议问题