Query Builder
Build MongoDB queries with the visual query builder
Query Builder
Build MongoDB queries visually without writing JSON syntax using the Query Builder interface.
Overview
The Query Builder provides a visual interface for constructing MongoDB find queries with filters, projections, and sort options.
Building Queries
Select field - Choose a field from your collection schema
Choose operator - Select comparison operator ($eq, $gt, $regex, etc.)
Enter value - Provide the comparison value
Add more conditions - Click + to add additional filters
Available Operators
Comparison
- Equals (
$eq) - Exact match - Not Equals (
$ne) - Does not match - Greater Than (
$gt) - Numeric/date comparison - Less Than (
$lt) - Numeric/date comparison - In Array (
$in) - Matches any value in list - Not In (
$nin) - Does not match any value in list
String Operations
- Contains (
$regex) - Substring match - Starts With - Beginning of string
- Ends With - End of string
- Case Insensitive - Ignore case in comparisons
Logical Operators
- AND - All conditions must match (default)
- OR - Any condition must match
- NOT - Negates a condition
- NOR - None of the conditions match
Field Projection
Select which fields to include in results:
- Click Fields button
- Check/uncheck fields to show
- Click Apply
Projecting only needed fields improves query performance and reduces data transfer.
Query Preview
View the generated MongoDB query:
- Click View Query to see raw JSON
- Copy query to use in your application
- Switch to Raw Mode to edit JSON directly
Switching to Raw Mode
For advanced queries, switch to Raw Mode:
- Click Raw Mode toggle
- Edit JSON directly
- Use MongoDB Extended JSON syntax
- Switch back to Builder Mode (if query is compatible)
Complex queries (e.g., with $where or $expr) may not be editable in Builder Mode after switching to Raw.
Common Query Patterns
Find Active Users
Field: status
Operator: equals
Value: active
Recent Documents
Field: createdAt
Operator: greater than
Value: (7 days ago)
Text Search
Field: description
Operator: contains
Value: mongodb