toData()function
toData(fields: FirestoreFields | undefined, caller: AnyCaller = toData): Data
| Param | Type | |
|---|---|---|
fields | FirestoreFields | The Firestore fields object to convert (missing means an empty document). |
caller | AnyCaller | Caller function used to attribute thrown errors. Defaults to toData |
| Return | |
|---|---|
Data | The plain data object. |
| Throws | |
|---|---|
unknown | ValueError if any field value has no recognised type. |
Convert Firestore REST API document fields back to a data object.
Examples
toData({ num: { integerValue: "123" } }) // { num: 123 }