Skip to content

Query Builder

The Query Builder allows you to create Firestore queries with an interactive UI.

Opening the Query Builder

Press F (Shift+F) on:

  • A collection in the Collections panel
  • A subcollection in the Tree panel

Query Builder Interface

┌─ Query Builder ─────────────────────────────┐
│ Collection: users                           │
│                                             │
│ WHERE:                                      │
│   [field] [==] (auto) [value]               │
│                                             │
│ ORDER BY:  [field] [ASC]                    │
│ LIMIT:     [50]                             │
│                                             │
│ [ Execute ]  [ Clear ]                      │
└─────────────────────────────────────────────┘
KeyAction
j / Move to next row
k / Move to previous row
h / Move to previous field
l / Move to next field
EnterEdit selected field / Execute button
EscClose query builder

Adding Filters

KeyAction
aAdd new WHERE filter
dDelete current WHERE filter

Filter Fields

Each WHERE filter has four components:

  1. Field - The document field to filter on (e.g., status, age, createdAt)
  2. Operator - Comparison operator (opens popup selector)
  3. Type - Value type (auto-detected or manual)
  4. Value - The value to compare against

Operators

OperatorDescription
==Equal to
!=Not equal to
<Less than
<=Less than or equal
>Greater than
>=Greater than or equal
inValue in array
not-inValue not in array
array-containsArray contains value
array-contains-anyArray contains any of values

Value Types

TypeDescription
autoAuto-detect type from value
stringText value
integerWhole number
doubleDecimal number
booleantrue/false
nullNull value
arrayArray (for in, not-in, array-contains-any)

ORDER BY

Set the field to sort results by and the direction:

  • ASC - Ascending (smallest first)
  • DESC - Descending (largest first)

LIMIT

Maximum number of documents to return (default: 50).

Executing Queries

Press Enter on the Execute button to run the query.

Top-level Collection Query

Results replace the entire tree view.

Subcollection Query

Results appear under the subcollection node in the tree, preserving the rest of the tree structure.

Clearing Queries

Press Enter on the Clear button to reset all filters, ORDER BY, and LIMIT to defaults.

Examples

Find Active Users

WHERE: [status] [==] (string) [active]

Find Users Over 18, Sorted by Age

WHERE: [age] [>] (integer) [18]
ORDER BY: [age] [ASC]

Find Recent Orders

WHERE: [createdAt] [>] (auto) [2024-01-01]
ORDER BY: [createdAt] [DESC]
LIMIT: [100]

Tips

  • Use auto type for most values - it will detect strings, numbers, and booleans
  • For date fields, enter ISO format dates as strings
  • Firestore requires composite indexes for some query combinations
  • If a query fails, check the error message for index requirements

Released under the MIT License.