DyanmoDb is storing value 1 instead of boolean value true

前端 未结 2 2053
一整个雨季
一整个雨季 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:48

    That's expected, have a look at the datatypes docs for dynamodb: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.DataTypes.html

    The Java type of Boolean will be stored as a number type in dynamodb, 0 or 1. Alternatively, you can use @DynamoDBNativeBooleanType to map a Java Boolean to the DynamoDB BOOL data type

提交回复
热议问题