Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

fix: support non-alphanumeric field name#1165

Merged
gcf-merge-on-green[bot] merged 2 commits intomainfrom
snake_field
Jan 13, 2022
Merged

fix: support non-alphanumeric field name#1165
gcf-merge-on-green[bot] merged 2 commits intomainfrom
snake_field

Conversation

@summer-ji-eng
Copy link
Copy Markdown
Contributor

Currently REST mode transcode doesn't support non-alphanumeric in the field name, and it cause firestore test 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' } }

@summer-ji-eng summer-ji-eng requested review from a team and alexander-fenster January 13, 2022 00:48
@summer-ji-eng summer-ji-eng added the automerge Merge the pull request once unit tests and other checks pass. label Jan 13, 2022
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 4f53efa into main Jan 13, 2022
@gcf-merge-on-green gcf-merge-on-green Bot deleted the snake_field branch January 13, 2022 01:24
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 13, 2022
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jan 19, 2022
🤖 I have created a release *beep* *boop*
---


### [2.29.4](v2.29.3...v2.29.4) (2022-01-19)


### Bug Fixes

* support non-alphanumeric field name ([#1165](#1165)) ([4f53efa](4f53efa))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
miguelvelezsa pushed a commit to googleapis/google-cloud-node that referenced this pull request Jul 23, 2025
miguelvelezsa pushed a commit to googleapis/google-cloud-node-core that referenced this pull request Oct 22, 2025
GautamSharda pushed a commit to googleapis/google-cloud-node-core that referenced this pull request Oct 29, 2025
GautamSharda pushed a commit to googleapis/google-cloud-node-core that referenced this pull request Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants