pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.12k stars 1.03k forks source link

Ignore additional properties #439

Closed davidwadge closed 6 years ago

davidwadge commented 6 years ago

Is it possible to set a flag to ignore additional properties when creating or updating a record? Currently, if our API changes and we pull down data into our React Native app without adding a schema migration, it will throw an exception when the model is saved with additional, irrelevant properties.

pubkey commented 6 years ago

No I'm sorry but this is not possible. Rxdb must always have to know which fields a document can have. Can you use the pre-insert-hook to strip all irrelevant fields before saving?

davidwadge commented 6 years ago

Thanks, that will do the job for the time being.