Skip to content

FR: mutable firestore query resultsΒ #7938

@wooliet

Description

@wooliet

Operating System

macOS 14

Browser Version

Chrome 120.0.6099.199

Firebase SDK Version

10.5.2

Firebase SDK Product:

Firestore

Describe your project's tooling

Vue app using Quasar

Describe the problem

I am trying to reduce the size of a snapshot result as each document in the snapshot is processed. This is not a monitored snapshot, but instead a single getDocs collection of documents.

The goal is general memory reduction. We need to build up a separate collection using the snapshot documents. I thought clearing out the source of the data as it is processed would be helpful.

But the more I dug into this, the more I realized everything in these results is immutable.

My feature request is to provide an alternate to the current getDocs such that results are mutable (either a new method or an additional argument to the existing method).

Steps and code to reproduce issue

const snapshot = getDocs(dataQuery);
const convertedData = [];
// will always evaluate to true
while (snapshot.docs.length > 0) {
  const doc = snapshot.docs.pop();
  const newData = getConvertedData(doc);
  convertedData.push(newData);
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions