Skip to content

Prevent setting null on fields that were not touched #549

Open

Description

@faizanabidnaqvi

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.

Activity

  1. faizanabidnaqvi commented on Sep 15, 2023

    @faizanabidnaqvi
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions