Search code examples
amazon-web-servicesamazon-dynamodbaws-sdk

Remove number value from column using Put?


I know we can use the update / remove operator to clear values, but is it possible to use the PUT operator? I don't think sending an empty string value will work since it's a number value.


Solution

  • Sure, you can use put-item. With put-item, you have to send the entire item, so simply put a version of the item without the attribute.

    You may be thinking that DynamoDB enforces a schema but it doesn't. Each item can defines its own set of attributes. Just don't include the attribute in the put if you don't want it.