Query Builder
Compose queries from structured fields instead of typing them — for MongoDB and Aerospike connections.
What It Is
On MongoDB and Aerospike connections the editor has a second mode. Switch the toggle above the editor from Shell to Builder and compose the query from labelled fields instead of typing it.
The toggle only appears on those two engines. PostgreSQL, SQL Server, ClickHouse and Elasticsearch are written in the editor, where autocomplete knows the schema you are connected to.
MongoDB
The fields build a find query:
- Filter — the query document
- Projection — which fields to return
- Sort — sort document
- Skip / Limit — paging values
These accept relaxed JSON, so you don't have to fight the syntax: unquoted keys, single quotes and trailing commas are all fine.
{ status: 'active', lifetimeValue: { $gte: 1000 }, } Aerospike
The fields build an AQL SELECT against the set you have open:
- Bins — which bins to return.
*for all, or a comma-separated list such asname, email. - WHERE — one of four shapes:
- None — scan the set
- PK — look one record up by primary key
- Filter — compare a bin against a value
- Range — a bin between two bounds
- Limit — how many records to return
Bin names are offered from the set you are pointed at, so the filter fields are a dropdown rather than free text. A PK value is quoted or left bare depending on whether it reads as a number, which is the distinction Aerospike makes between a string key and an integer one.
SELECT * FROM test.users WHERE PK = 'u-1024' LIMIT 50
SELECT name, email FROM test.users WHERE age > 30 LIMIT 50
SELECT * FROM test.orders WHERE total BETWEEN 100 AND 500 LIMIT 50 Switching Between the Two
Builder and Shell are two views of the same query, and how far that goes depends on the engine.
- MongoDB — both directions. Switch to Shell and the builder state becomes
a regular
findstatement you can extend by hand; switch back and your edits are read back into the fields. - Aerospike — one direction. The builder writes the AQL, but a statement you have edited in the Shell is not parsed back into the fields. Switching to Builder gives you the fields as you last left them, so finish a hand-edited query in the Shell.
Tip: The builder is a good way to learn the query language — set the query up visually, then flip to Shell to see exactly what it generates.
What About Aggregations?
Aggregation pipelines are written in the shell editor, where autocomplete suggests stages and operators as you type — there is no separate visual pipeline builder.
Next Steps
Run your query and explore the results panel.