@squidcloud/client
    Preparing search index...

    Function loadQueryResultDocIds

    • Paginates through the query and returns the docIds of all matching documents in a form that can be passed back to collection.doc(id) to retrieve the same documents. Does NOT read ref.data — only the index identifiers — so it is safe to call when document data is being mutated concurrently, and uses O(N) of small ids rather than O(N) of full document payloads.

      Use this instead of visitQueryResults when the per-row processing may mutate the same collection in a way that affects which documents match the query. Live pagination breaks in that case: a write that takes a row out of the result set evicts refs in the same page (DataManager reacts globally to mutations), and subsequent ref.data reads throw "No data found". The recommended pattern is:

      const ids = await loadQueryResultDocIds(query);
      for (const id of ids) {
        const doc = await collection.doc(id).snapshot();
        if (!doc) continue;
        // ...mutate doc...
      }
      

      Type Parameters

      Parameters

      Returns Promise<DocIdOrDocIdObj[]>