在表中存储布尔值

时间:2019-07-04 11:21:53

标签: java amazon-dynamodb dynamodb-queries

是否可以在DynamoDB中存储true或false布尔类型?我看到它可以存储为0或1。下面是创建表的过程。

List<AttributeDefinition> attributeDefinitions = new ArrayList();

        attributeDefinitions.add(new AttributeDefinition()
                .withAttributeName("status")
                .withAttributeType(ScalarAttributeType.N));

此状态可以为true或false。

Map<String, AttributeValue> attributeValues = new HashMap();
        attributeValues.put("status",new AttributeValue().withBOOL(true));

,但没有运气。有什么办法可以映射吗?

0 个答案:

没有答案