I have a simple table in DynamoDb local and try to put an item like this:
var options = {name : "test",
creator : "Testcreator", description : "test",
moderators : ["Testmoderator"]};
var obj = {
name: {"S": options.name},
restricted: {"BOOL": options.restricted || false},
creator: {"S": options.creator},
description: {"S": options.description || ""},
moderators: {"SS" : options.moderators || []}
};
var params = {
"TableName": "MY_TABLE",
"Item": obj,
Expected: {
name: {Exists: false}
}
};
dynamodb.putItem(params, function (err, data) {
ppJson(err);
});
According to the documentation, boolean values are allowed, put I am getting the following error when I try this code in the DynamoDB Local shell:
"code":"UnexpectedParameter",
"message":"Unexpected key 'BOOL' found in params.Item['restricted']"
...
Is there an error in my code or is this a problem with the javascript API?