-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Cannot convert undefined or null to object' when updating attribute to null or empty array #276
Comments
Hi @chrisbrantley This fail happens due to the inability of dynamo-easy to handle null values -> it filters out all null/undefined/empty values. We will address this in the near future and bring null-value support to dynamo-easy; see #285 |
I need to update an array with an empty array and get the same error. Setting something to an empty array seems like a valid usecase. |
I am facing the same issue as @fredspivock often you want to have lists of objects that can be added and removed, via updating, and a very common scenario is setting that list back to being empty. Removing is not really an option as you want that empty array so you can append objects. so just to explain further this call does not work and results in example would be in terms of update operations const operation = update2(Breakfast, 'eggs').set([]);
// this currently does not work it kind of should happy to do make this change if you can point me to a good starting point. Problemits here that an empty array will would filtered via the deepfiler call which would always return without knowing the full details of deepfilter and why it rejects empty array I cannot really deep dive into a fix here. I can make one but it will be hack |
Describe the bug
I'm trying to update some attributes to
null
or[]
(empty array) and I'm getting the following error:To Reproduce
Expected behavior
Since both Null and empty arrays are valid DynamoDB values I would expect the operation to succeed.
Additional context
This error only happens with update operations. I can call
store.put()
with the same values and it works correctly.I am using Typescript.
The text was updated successfully, but these errors were encountered: