firebase / firebase/firebase-js-sdk

Cannot update backticked nested field, when it contains / (slash)

Open
#8,659 3 comments 0 reactions 1 assignee Claimed by @wu-hui View on GitHub
api: firestore needs-attention question stack:Other
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

MacOS

### Environment (if applicable)

Chrome 131

### Firebase SDK Version

11.0.2

### Firebase SDK Product(s)

Firestore

### Project Tooling

Solid.js

### Detailed Problem Description

Firestore allows to have a map field, whose keys contains slashes, e.g. abc/def/123. You can write a document from js sdk with that kind of fields and keys, however if updating doc with nested field dot notation it throws error: **Paths must not contain '~', '*', '/', '[', or ']'**. The docs says: A quoted field name starts and ends with the backtick character. For example, foo.\`x&y\` refers to the x&y field nested under the foo field.

I know that FieldPath can be used and it works with FieldPaths, but it should work also with backticks.

### Steps and code to reproduce issue

updateDoc(doc(getFirestore(), "doc123"), {["abc.\`def/123/455\`"]: true})

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.