Consider an operation like so:
ref.set({
a: {
b: {
c: undefined
}
})
With ignoreUndefinedProperties: true, I would have expected the result written to Firestore to be
However the actual result is that the entire a→b→c nested chain is entirely omitted:
Is this the intended behaviour?
I believe it is due to these lines below, which, when there are no other non-undefined fields in any of the objects, flows all the way up the chain causing the entire nested chain to be omitted.
https://github.com/googleapis/nodejs-firestore/blob/ac35b372faf32f093d83af18d487f1b3f23ee673/dev/src/serializer.ts#L205-L207
Essentially those lines mean than an object consisting entirely of undefined fields should be omitted (the object itself), rather than just serialised as an empty object.
Tested on @google-cloud/firestore version: 6.7.0.
Consider an operation like so:
With
ignoreUndefinedProperties: true, I would have expected the result written to Firestore to beHowever the actual result is that the entire
a→b→cnested chain is entirely omitted:Is this the intended behaviour?
I believe it is due to these lines below, which, when there are no other non-
undefinedfields in any of the objects, flows all the way up the chain causing the entire nested chain to be omitted.https://github.com/googleapis/nodejs-firestore/blob/ac35b372faf32f093d83af18d487f1b3f23ee673/dev/src/serializer.ts#L205-L207
Essentially those lines mean than an object consisting entirely of
undefinedfields should be omitted (the object itself), rather than just serialised as an empty object.Tested on
@google-cloud/firestoreversion:6.7.0.