Firetool

Home / Docs / Search

Docs

Search Firestore data

Find a value in the rows you've already loaded, without reading anything, or look for it in the collections you choose, seeing first what it will read. You need Firetool 4.1 or later.

Search the loaded rows

  1. Open the collections you want to look through, and run their queries (with Load more if you need more rows).
  2. Press Ctrl+K (⌘+K on a Mac) and type at least two letters of the value: part of a name, an email address, an order number.
  3. Matches show under In loaded rows: the matching text, then the field it's in, the document's path and the project. A value inside a map or a list is found too, and so is a document ID. Field names alone don't count: every row of a collection has them.
  4. Choose one to open its tab and the document.

This looks only at rows already loaded in your open tabs, so it reads nothing from Firestore and costs nothing. It shows up to 20 matches, at most 5 from each tab.

Find a value in collections

To look in collections you haven't loaded, Firetool asks Firestore. Firestore can't search every field of every document, so you name the field (or look up a document ID).

  1. Open it from any of these:
    • the command palette: type the value, then choose Find “…” in collections… under the matches, or the action Find a value in collections…;
    • a collection's Actions ▾ → Find a value in collections…;
    • right-click a cell in the table → Find this value in other collections…, which fills in the field and the value.
  2. In Find a value, check the Value and its Type: Auto guesses, or choose Text, Number, True / false or Null. A number stored as text is only found as Text.
  3. Under In the field, type the field's name; use dots for a field inside a map, such as address.city. The fields of the open collection are suggested.
  4. Tick the Collections to search. The open tab's collection is ticked to start; All and None tick or clear them all. Firetool remembers your choices for each project.
  5. Read the line under the list: how many queries it will run, the most documents it may read, and the estimated cost.
  6. Choose Search. With more than one collection ticked, Firetool asks first, with the same numbers. Stop ends a long search after the collection it's on.

It searches the collections at the top of the database, not subcollections. Searching only reads, so it works in the Free edition and with the Viewer role.

Look up a document ID

Choose As a document ID instead of a field, type the ID as the value, and tick the collections. Firetool reads that one document in each collection: one read each, whether it's there or not.

Search everywhere

One search over several kinds of places in a project and database: collections, collection groups, Authentication users and Storage files. You need Firetool 4.5.2 or later.

  1. Press Ctrl+Shift+F (⌘⇧F on a Mac), or choose View → Search everywhere…, or type the value in the command palette and choose Search everywhere for “…”….
  2. Type what to look for, and choose how to match it:
    • Field equals: the field you name holds exactly this value (with its Type, as in Find a value);
    • Field starts with: a text field begins with it, such as the first letters of a name;
    • Document ID: one read of that document in each collection;
    • Document ID starts with: the IDs in each collection that begin with it.
  3. Choose where to look: tick Collections; type Collection groups, collection names with commas between (a group is every collection with that name, at any depth, such as every comments under every post); tick Authentication users to look the text up as an exact email, phone number (starting with +) or UID; tick Files in a bucket to list files whose name starts with the text.
  4. Read the line under the places: the queries and reads it will make, and the estimated cost. Users and files aren't document reads. A place that can't take the search is left out and says why: a document ID needs its collection's path, so collection groups are searched by a field.
  5. Choose Search. With more than one collection or group, Firetool asks first. The search is listed in Tasks, where it can be paused or cancelled; Stop ends it after the place it's on.

Results are grouped by place: a document opens in its tab, a user opens their user page, a file opens in Storage with its details, and Show all in Storage lists every file with that start. A collection group query needs the field indexed for collection groups; when Firestore refuses one for that, the result shows Firestore's message and Index this field for groups…, which opens the field's settings with Collection group ticked (changing indexes needs Pro).

Search everywhere only reads, so it works in the Free edition and with the Viewer role. Each place stops at 20 matches.

Results

  • Each collection shows how many it found, none, or the error Firestore gave. A field search lists up to 20 matches a collection, with the field's value beside each ID.
  • Choose a document to open it.
  • Open as a query opens the collection in a tab with the filter already set and run, so you can load the rest, edit or export them.
  • When nothing is found, check the field's name and try another Type: 42 stored as text and 42 stored as a number are different values to Firestore.

What it reads

  • The loaded rows: nothing.
  • A field: one query a collection, reading up to 20 matching documents. A query that finds nothing is still billed one read.
  • A document ID: one read a collection.
  • A field's start, or a document ID's start (Search everywhere): one query a collection or group, reading up to 20 matching documents.
  • Users and files (Search everywhere): no document reads.

The reads count in the status bar like any other query, and the policy and roles of the project apply.

Questions

Can Firetool search every field of every document?

No. Firestore has no full-text search: it can only find documents by a field you name. Firetool searches every field of the rows you've already loaded, and looks a value up in a named field, or as a document ID, in the collections you choose.

Does searching cost anything?

Searching the loaded rows from the command palette reads nothing. Find a value runs one query a collection, reading up to 20 documents each (or one read a collection for a document ID), and shows the reads and the estimated cost before it starts.

Why isn't a value I can see found?

Usually the type: a number stored as text is only found with Type set to Text, and the other way round. Also check the field's name, including its case, and that the collection is ticked. Find a value searches only the collections at the top; for subcollections, type their name under Collection groups in Search everywhere.