dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

Way to skip Exception/Error when field does not have a mapping or alias

Open salv0 opened this issue 2 years ago • 4 comments

Hello there,

While using the Entity.putBatch followed by table.batchWrite() I incurred in the following error: Error: Field 'newField' does not have a mapping or alias

The entity I want to persist comes from an external API, so it can happen that some new fields are added without notice, and that's exactly what happened in this case. Is there a way to instruct dynamodb-toolbox to just "skip" persistence of unknown fields, instead of rising this error?

Or is there a better way to approach this kind of problem?

@jeremydaly Thank you very much for the help!

salv0 avatar Jan 27 '22 16:01 salv0

any news about this? @jeremydaly

salv0 avatar Feb 21 '22 09:02 salv0

is this project dead?

salv0 avatar Jun 24 '22 10:06 salv0

@naorpeled, let's add an option to the put, update and putBatch methods to allow for skipping the entity schema check.

Maybe strict: false?

Also, all other checks (typing, required, etc.) should be enforced. This will just bypass a strict schema check for defined fields. Make sense?

jeremydaly avatar Jul 19 '22 16:07 jeremydaly

@naorpeled, let's add an option to the put, update and putBatch methods to allow for skipping the entity schema check.

Maybe strict: false?

Also, all other checks (typing, required, etc.) should be enforced. This will just bypass a strict schema check for defined fields. Make sense?

100%, will implement it asap :)

naorpeled avatar Jul 19 '22 17:07 naorpeled