Does the ORM currently deal with nullable fields? In my case I have a collection of documents that have a deletedAt field. This field can either be null or a timestamp (corresponding to if the document is deleted or not).
When I try to get the documents of this collection and call .toData() I receive the following exception:
TypeError: Cannot read property 'toDate' of undefined
at /…/node_modules/firebase-firestorm/lib/decorators/timestamp.js:52:88
at Function.FieldUtils.process (/…/node_modules/firebase-firestorm/lib/utils/FieldUtils.js:67:20)
at toData (/…node_modules/firebase-firestorm/lib/decorators/timestamp.js:52:33)
at Object.field.toData (/…/node_modules/firebase-firestorm/lib/decorators/timestamp.js:72:20)
at /…/node_modules/firebase-firestorm/lib/Entity.js:20:39
at Map.forEach (<anonymous>)
at MyModel.Entity.toData (/…/node_modules/firebase-firestorm/lib/Entity.js:18:16)
It would be great to know if this is expected behaviour. Same concerning fields that are defined on the model but do not exist on the document (if so, this would mean potentially writing migrations in the future).
Does the ORM currently deal with nullable fields? In my case I have a collection of documents that have a
deletedAt
field. This field can either benull
or a timestamp (corresponding to if the document is deleted or not).When I try to get the documents of this collection and call
.toData()
I receive the following exception:It would be great to know if this is expected behaviour. Same concerning fields that are defined on the model but do not exist on the document (if so, this would mean potentially writing migrations in the future).