Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Querying by id in Firestore Console [closed]

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.

like image 505
1man Avatar asked Feb 17 '20 16:02

1man


People also ask

Can two documents have the same ID in firestore?

New document with same ID should not be allowed in the same collection. It should be possible to fetch an already existing document from a previous import.


1 Answers

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.

like image 144
Frank van Puffelen Avatar answered Sep 22 '22 01:09

Frank van Puffelen