firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.14k stars 185 forks source link

Prevent setting null on fields that were not touched #549

Open faizanabidnaqvi opened 12 months ago

faizanabidnaqvi commented 12 months ago

Hi there

In firecms v2, I noticed that it sets all fields that were not touched (like strings that we didn't set for an entity) to null. Is there a way to prevent this? I could do this through a callback and set all fields to undefined but it will be nice if there was a way to do it using the schema. I could also define default values but that won't make sense for certain fields.

In v1, it didn't set any fields that we didn't touch which was ideal for our use case. Having default null values affects other clients that use the database for our case.

faizanabidnaqvi commented 12 months ago

I saw another thread discussion regarding setting null values for non-required fields. I feel like non-required fields, if not set and if not touched at all, should not even be added to firestore.