clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels
Other
490 stars 110 forks source link

Allow null properties on nested data #93

Closed diit closed 6 years ago

diit commented 7 years ago

Expected

Sending a null value to a nested property results in it being deleted. Should be consistent with root level schema.

Result

Dynogel throws validation error.

Current solution

appending every value in nested schema with .allow(null)

clarkie commented 7 years ago

Thanks @diit, I probably haven't got time at the minute to do this but if you wanted to submit a PR or create a branch with some failing tests that'd be a great start.

Thanks

jkav77 commented 6 years ago

Setting a property to a null value deletes that property in dynogels, according to the README.md. This it is consistent with the root level properties in the schema. Although dynamodb now allows null values, dynogels uses a null value assignment to indicate the property should be removed.