toFirestoreFields()function
toFirestoreFields(data: Data, caller: AnyCaller = toFirestoreFields): FirestoreFields
| Param | Type | |
|---|---|---|
data | Data | The data object to convert. required |
caller | AnyCaller | Caller function used to attribute thrown errors. Defaults to toFirestoreFields |
| Return | |
|---|---|
FirestoreFields | The Firestore fields object. |
| Throws | |
|---|---|
unknown | ValueError if any prop value cannot be represented. |
Convert a data object to Firestore REST API document fields.
- Props with
undefinedvalue are skipped (matching JSON serialisation).
Examples
toFirestoreFields({ num: 123 }) // { num: { integerValue: "123" } }