Working with Data
Filtering and Searching
Filter and search MongoDB documents using query syntax
Filtering and Searching
Learn how to filter and search documents using MongoDB query syntax in MongoDash.
Query Builder
MongoDash provides a query builder interface for constructing MongoDB queries without writing raw JSON.
Basic Filters
Create simple equality filters:
- Field equals value -
{ "status": "active" } - Numeric comparisons -
{ "age": { "$gt": 21 } } - String matching -
{ "name": { "$regex": "^John" } }
Operators
Common MongoDB query operators:
$eq- Equals$ne- Not equals$gt- Greater than$gte- Greater than or equal$lt- Less than$lte- Less than or equal$in- In array$nin- Not in array$regex- Regular expression match
Text Search
Use MongoDB's text search for full-text queries:
{
"$text": {
"$search": "mongodb database"
}
}
Text search requires a text index on the collection.
Compound Queries
Combine multiple conditions using logical operators:
AND Queries
{
"status": "active",
"age": { "$gte": 18 }
}
OR Queries
{
"$or": [
{ "status": "active" },
{ "status": "pending" }
]
}
Array Queries
Query documents with array fields:
- Contains element -
{ "tags": "mongodb" } - Array size -
{ "tags": { "$size": 3 } } - Element match -
{ "items": { "$elemMatch": { "price": { "$gt": 100 } } } }
Date Queries
Filter by date ranges:
{
"createdAt": {
"$gte": { "$date": "2024-01-01T00:00:00Z" },
"$lt": { "$date": "2024-02-01T00:00:00Z" }
}
}
Saving Queries
Save frequently used queries for quick access:
Run your query in the Data Explorer
Click Save Query button
Enter a name and optional description
Access saved queries from the sidebar