firebase / firebase/firebase-js-sdk

is:issue subcollection name's don't support colons ":"

Open
#9,419 1 comment 0 reactions 1 assignee Claimed by @cherylEnkidu View on GitHub
api: firestore needs-attention question
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

Windows

### Environment (if applicable)

NodeJS v20.17.0, ReactJS 18.2.0

### Firebase SDK Version

"firebase": "^11.1.0" and "firebase-admin": "^13.0.0"

### Firebase SDK Product(s)

Firestore

### Project Tooling

Tried several. It seems related to the SDK because it happens under multiple dev techniques (e.g browser, command, script, etc.).

### Detailed Problem Description

It's not possible to get documents from a subcollection when the subcollection uses a name with a colon ":".
It _is_ possible to call the subcollection without the semicolon.
This is true on both the modular and admin SDK.

### Steps and code to reproduce issue

Create a document with two subcollections. Call the first "SubCollection: First" and "SubCollection Second".
Populate both of them with the same documents, ideally more than one.
Try to query using whatever technique you want. I've tried many. But the prescriptive technique is to a collectionGroup.

First won't return anything but the parent document. Second will return all documents in the SubCollection.

Note: The REST API allows you to query the data so long as you escape the subcollection name using encodeURIComponent which replaces the colon and space with %3A%20.

The SDKs reject the encoding.

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.