This repository was archived by the owner on Nov 18, 2025. It is now read-only.
Commit 4f53efa
authored
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' } }
```1 parent 7c3d7f1 commit 4f53efa
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
0 commit comments