Open lietu opened 3 years ago
Alternatively e.g. by extending Field()
or similar from pydantic
Pydantic dict() and json(), or the corresponding model_dump() in v2, support the param:
exclude_unset: Whether to exclude fields that are unset or None from the output.
So maybe Firedantic save() could have it similarily easily.
But I agree that model conf for it would be nice.
Golang firestore library supports the ability to tag fields as omitempty meaning they will not get stored in the DB when not set. This could be done via e.g. combining
Optional
with aConfig
option like