Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

.where(admin.firestore.FieldPath.documentId(), 'in', ['id1', 'id2']) fails: '... FieldPath.documentId() must be a string or a DocumentReference' #990

Description

@xaphod

Environment details

  • OS: Firebase Function NodeJS, running on the emulator from Firebase CLI 7.16.1
  • Node.js version: 13.11.0
  • @google-cloud/firestore version: 3.7.2
  • firebase-admin version: 8.10.0

Steps to reproduce

    const admin = require('firebase-admin');
    const arr = ['id1', 'id2'];
    const m = await db
      .collection('media')
      .where(admin.firestore.FieldPath.documentId(), 'in', arr)
      .get();

Expected: able to query a list of document IDs in a single collection.

Actual:

Error: The corresponding value for FieldPath.documentId() must be a string or a DocumentReference.
    at CollectionReference.validateReference (node_modules/@google-cloud/firestore/build/src/reference.js:1325:19)
    at CollectionReference.where (node_modules/@google-cloud/firestore/build/src/reference.js:1038:26)

Does anyone know a workaround? Thanks! (edited several times for clarity)

Metadata

Metadata

Labels

api: firestoreIssues related to the googleapis/nodejs-firestore API.triage meI really want to be triaged.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions