Search code examples
firebasegoogle-cloud-platformgoogle-cloud-firestorefirebase-console

Querying by id in Firestore Console


Currently, as far as I know, there is no command-line interface for querying Firestore. The only way to query our documents is to do it through our own program, or through Firestore console. In the console, the only way to query a document by its id is to use the browser "Find" feature. However, when the number of documents in a collection increases above a threshold, which I don't know, Google Chrome cannot find the id. It's very inconvenient to scroll through the list of documents and use the find function of the browser again and again to find the id.

Please advise a more efficient way or implement a more efficient way to query documents by id in Firestore Console.


Solution

  • While you can't filter a collection by a document ID, you can find a document with a specific ID by entering it in the little address bar/breadcrumb trail that sits above your data structure in the console.

    Steps:

    1. Select the collection that the document is in
    2. Hover over the breadcrumb trail at the top and click on the pencil icon

      enter image description here

    3. Enter a / and then the ID of the document

      enter image description here

    4. Hit Enter

    The console will now load the document with the ID you entered.