Queries & JavaScript

A MongoDB® query builder for Mac, from one filter to a whole script.

Use familiar MongoDB shell syntax for a quick lookup, or open Query Builder for a longer script. Your console output, results, and saved queries have a native home on your Mac.

Download for MacFree on the Mac App Store

Queries & JavaScript is part of the free app. macOS 15 or later.

  • Shell-style queries
  • JavaScript scripts
  • Saved queries
The Query Builder running an aggregation on the customers collection, with its results in a table.The Query Builder running an aggregation on the customers collection, with its results in a table.
The real app, with sample data.

A question, a query. An answer you can use.

From a quick filter to a JavaScript script, with useful queries saved nearby.

Queries & JavaScript, in detail.

A query bar that speaks shell syntax

Every collection has Filter, Project, Sort, Collation, Limit and Skip fields. Write them the way you would in the MongoDB shell: unquoted keys, ObjectId("…"), ISODate("…"), NumberDecimal("…"), regular expressions and comments all work.

The fields colour your syntax, match brackets and mark a mistake at the place it happens, before you run anything.

Completion that knows your data

Tallhorn samples the collection and suggests what it finds: field paths with their types and how often each one is present, query operators, BSON constructors, and the actual values of fields that only hold a few. You can turn suggestions off in Settings.

The Query Builder, for longer work

The Query Builder is the first row of the sidebar. Choose a connection, a database and, if you like, a collection, then write a statement such as db.orders.find(…).sort(…).limit(…), findOne, aggregate, countDocuments or distinct. Run it with ⌘↩ and cancel it with ⌘. (Command-period).

Results appear as a table, a tree or JSON, the same views as everywhere else in the app.

JavaScript with a mongosh-style db

When one statement is not enough, write a script: variables, functions, loops and classes, print and console output, and a db object that reaches other databases with db.getSiblingDB. Output goes to a Console tab and the final result to a Results tab.

Scripts can write, on connections that allow it. Tallhorn asks before each kind of write a script makes, and a read-only connection refuses them.

History and saved queries

Each collection keeps a searchable history of the queries you ran, which you can re-run or pin. Give the ones you reuse a name and save them, for one collection or globally, in folders. Saved queries stay on your Mac.

How it goes, step by step.

Three steps from opening Tallhorn to having what you came for.

  1. Choose the database context

    Select a connection, database, and collection for the work at hand.

  2. Write and run

    Execute a single statement or a script, then inspect its console output and results.

  3. Save your next starting point

    Give a reusable query a name and keep it with the collection or in your global library.

At a glance.

Query fields
Filter, project, sort, collation, limit and skip
Syntax
MongoDB shell syntax with BSON constructors
Statements
find, findOne, aggregate, countDocuments, distinct
Scripts
JavaScript with a mongosh-style db, Console and Results tabs
Saved queries
Per collection or global, in folders, stored locally
Price
Free

Questions about queries & JavaScript, answered.

Is this a full embedded mongosh runtime?

No. Tallhorn runs JavaScript through JavaScriptCore with a mongosh-style database API. It does not promise Node.js modules or complete mongosh compatibility.

Can scripts write to my database?

Yes, on connections that allow writes. Every write in a script requires confirmation; a read-only connection refuses it.

Do I have to learn a new query language?

No. Tallhorn uses MongoDB’s own shell syntax, so a filter or a statement you already have can be pasted in and run.

Can I cancel a slow query?

Yes. Every query has a Cancel button (⌘.), and a time limit that you set in Settings stops queries that run too long.

Where are saved queries stored?

In one file on your Mac. They are not synced or uploaded. Deleting a connection deletes the queries saved for it.

Can I run npm packages in a script?

No. Scripts run in the JavaScript engine built into macOS, with a mongosh-style db object, not in Node.js.