Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support non-alphanumeric field name (#1165)
Currently REST mode transcode doesn't support non-alphanumeric in the field name, and it cause [firestore test](https://github.com/googleapis/nodejs-firestore/blob/main/dev/system-test/firestore.ts#L754-L771) fails. code sample: ``` test() { const ref = randomCol.doc('doc'); return ref .set({'!.\\`': {'!.\\`': 'value'}}) .then(() => { return ref.get(); }) .then(doc => { // SEE ERROR ON THIS LINE expect(doc.data()).to.deep.equal({'!.\\`': {'!.\\`': 'value'}}); return ref.update(new FieldPath('!.\\`', '!.\\`'), 'new-value'); }) .then(() => { return ref.get(); }) .then(doc => { expect(doc.data()).to.deep.equal({'!.\\`': {'!.\\`': 'new-value'}}); }); } ``` Error ``` AssertionError: expected { '.': { '.': 'value' } } to deeply equal { '!.\\`': { '!.\\`': 'value' } } ```
- Loading branch information