googleapis / googleapis/google-cloud-node

getPartitions on all queries

Offen
#7,488 4 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
api: firestore library: nodejs-firestore type: feature request
Vorherrschende Sprache
TypeScript
Sterne
3.2k
Forks
712
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
104

Beschreibung

**Is your feature request related to a problem? Please describe.**
I've seen that the [`getPartitions` API](https://googleapis.dev/nodejs/firestore/latest/CollectionGroup.html#getPartitions) is only available on collection group queries, but not on normal queries. I was wondering why that is. You can always rewrite to use a `collectionGroup`, but it feels weird and unintuitive as a user of the SDK.

**Describe the solution you'd like**
Have partitions on these queries:

```ts
firestore().collection('collectionA/docB/collectionC').getPartitions();
```

**Describe alternatives you've considered**
Alternative, would be to do this:
```ts
firestore().collection('collectionC').getPartitions();
```

And to check for the path ` collectionA/docB/...` on the client.

**Additional context**
This is probably because of the restrictions that [no filters are supported](https://firebase.google.com/docs/firestore/reference/rest/v1beta1/projects.databases.documents/partitionQuery), right?

And to support others there might be the need for creating an additional Firestore index, which is not supported yet.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Überprüfung der vorhandenen getPartitions-API und der verlinkten Firestore-Dokumentation zu partitionQuery. Ermittle, wie sich normale Collection-Abfragen von Collection-Group-Abfragen unterscheiden und ob die API-Einschränkungen oder Indexanforderungen die Unterstützung verhindern. Als erledigt gilt die Aufgabe, wenn das angeforderte Beispiel für einen Collection-Pfad unterstützt wird oder die Einschränkung eindeutig dokumentiert ist, falls eine Implementierung nicht möglich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
google-cloud, typescript
Bereich
api, database
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.