Query MongoDB with find, projection and batches, read-only

Run read-only MongoDB find queries with filters, projection, ordered sort and batch navigation. Extended JSON in and out, authSource support and SSH tunnels.

Transport: Official MongoDB Go driver (port 27017 by default)

A MongoDB find query on the products collection with a projection and sort, and Previous batch / Next batch controls under the results.
A MongoDB find query on the products collection with a projection and sort, and Previous batch / Next batch controls under the results.

What you can do today

  • Database and collection navigation
  • JSON find with filter, projection, ordered sort, skip and limit
  • Extended JSON filters such as $oid and $date, and Extended JSON results
  • Previous batch / Next batch navigation that rewrites the query for you
  • Configurable authentication database (defaults to admin)
  • TLS with certificate verification and SSH tunnels

Not supported yet

  • Editing, inserting or deleting documents
  • Aggregation pipelines
  • mongodb+srv:// (SRV) and replica-set connection profiles

Find queries, not a shell

DevOpsPad does not embed a JavaScript shell. A MongoDB query is a JSON document that describes one find call, which makes it read-only by construction:

{
  "collection": "products",
  "filter": {"active": true},
  "projection": {"name": 1, "price": 1},
  "sort": {"price": -1},
  "skip": 0,
  "limit": 100
}

Sort keys keep the order you write them in, and _id is appended as a tie-breaker when you leave it out, so batches are stable.

Types survive the round trip

Filters accept Extended JSON, for example {"_id": {"$oid": "507f1f77bcf86cd799439011"}}. Results come back as canonical Extended JSON, so ObjectIDs, dates and 64-bit numbers are shown exactly as stored instead of being converted to lossy JavaScript numbers.

Batch navigation

Previous batch and Next batch generate the next query, put it in the editor and run it, so what you see always matches the query text. Editing the query disables batch navigation until you run it again. Offset-based batches can shift if documents are written concurrently; for deep paging use a range filter on an indexed field instead.

Authentication and network

Set Authentication database to the database where the user was created; it defaults to admin. TLS with certificate verification and SSH tunnels work the same way as for every other connector.

See MongoDB find queries for the full syntax, or the MySQL connector for relational data.

Help articles

Frequently asked questions

What query language does the MongoDB connector use?

A JSON find document with collection, filter, projection, sort, skip and limit. It maps directly to a MongoDB find call, so there is no shell or JavaScript to execute.

How many documents does a MongoDB query return?

The limit defaults to 100 and can be set from 1 to 500. Skip can be 0 to 1,000,000, and each response is capped at 8 MiB of encoded Extended JSON.

Can DevOpsPad connect to MongoDB Atlas?

Not with an SRV connection string yet. SRV and replica-set profiles are on the roadmap; today the connector takes a single host and port.