Skip to content

MongoDB probe

The MongoDB probe connects to a MongoDB deployment, runs one operation, and returns the result — the matching documents, a write summary (matched/modified/inserted/deleted counts), or a server error. It is a database protocol, so it closes the same integration loop as the SQL probe: after an HTTP call writes a record, a MongoDB step can confirm the document actually landed.

Like the MySQL probe, the MongoDB probe is library-backed — it wraps the official MongoDB Java driver, which handles the wire protocol, SCRAM authentication, TLS, and connection pooling. The query/extract/chain path has no need for wire-level control, so a driver is the right tool.

FieldDescription
HostHostname or IP of the MongoDB server (default port 27017)
PortServer port (default: 27017)
DatabaseThe database the operation targets
Connection stringA full mongodb:// or mongodb+srv:// URI. When set, it overrides host/port/auth/TLS — the idiom for Atlas and replica sets.
Auth sourceThe authentication database for the credential (default: admin)
TLS modeDisabled, Required (encrypt without verifying the hostname), or Verify full (verify the certificate chain and hostname)

MongoDB logins use the credential store — the username and password never live on the probe. A login is a username + password, which maps to a Basic credential (username in config, password in secrets). Select an existing credential or create a Basic one in the probe’s Auth row; the effective-credential panel, on-demand secret reveal, and per-run override work exactly as for the MySQL probe. If no credential is selected, the connection is attempted anonymously.

Pick the Operation; the editor shows only the fields that operation needs. JSON fields accept MongoDB Extended-JSON / shell syntax.

OperationFieldsDoes
Findcollection, filter, projection, limitRead documents matching the filter
Insertcollection, documentInsert one document, or many when the document is a JSON array
Updatecollection, filter, updateupdateMany with an update document (e.g. {"$set":{…}})
Deletecollection, filterdeleteMany matching the filter
Aggregatecollection, pipelineRun an aggregation pipeline (a JSON array of stages)
Countcollection, filterCount matching documents
Run commandcommandRun a database command, e.g. {"ping":1} or {"serverStatus":1}
List collectionsList the collection names in the database

A blank filter means {} (match everything). {{variable}} placeholders in the collection and the JSON bodies are resolved from the active environment before the operation runs — deliberately including substitution into the query bodies, which enables both data-driven chaining and NoSQL-injection testing.

The operation section has a Form / Shell toggle:

  • Form — the structured fields above (operation type, collection, filter, projection, …). Best for simple, single-shape operations.
  • Shell — one editor where you paste a query exactly as you’d type it in the mongo shell. The structured form can’t express a full query (sort, skip, chained cursor modifiers); Shell mode can.
db.users.find({ status: "active" }, { _id: 0, name: 1 }).sort({ createdAt: -1 }).skip(10).limit(20)
db.users.find({ _id: ObjectId("5f2b…") })
db.orders.aggregate([{ $match: { paid: true } }, { $group: { _id: "$cust", n: { $sum: 1 } } }])
db.users.updateMany({ active: false }, { $set: { active: true } })
db.runCommand({ ping: 1 })
db.getCollectionNames()

Supported: find / findOne, aggregate, count / countDocuments, insertOne / insertMany, updateOne / updateMany, deleteOne / deleteMany, runCommand, getCollectionNames, plus the cursor modifiers .sort(), .skip(), .limit() and .projection(). Shell helpers such as ObjectId(…), ISODate(…), NumberLong(…) and /regex/ literals are understood. {{variable}} placeholders resolve into the whole query string (same chaining + NoSQL-injection use as Form mode). Press Ctrl+Enter to send.

A malformed query (missing db., an unbalanced bracket, an unsupported method) is reported as a clean failed result with a message — never a crash, and no connection is opened.

  • Reads (Find / Aggregate / Run command / List collections) → the returned documents, pretty-printed as JSON, with a document count.
  • Writes → a summary chip: inserted, matched/modified, or deleted counts.
  • Server error → a red panel with the message and MongoDB error code / code name. A rejected operation is a valid failed result, not a crash.

The status bar shows the operation type, the relevant counts, and the client-side round-trip duration.

Use these in chain steps to pull values out of a MongoDB result:

ExtractorReturns
MONGO_SUCCESS"true" / "false"
MONGO_DOC_COUNTnumber of documents returned (or matched, for Count)
MONGO_FIELDa field out of the returned documents — expression field, [n].field, or [*].field
MONGO_ERROR_CODEthe MongoDB error code (0 on success)
MONGO_JSONthe whole result as a JSON array

MONGO_FIELD is not limited to the first document: name reads the first document’s field (the convenient default), [2].email reaches document 2, and [*].email returns the field from every document, newline-joined — ready to feed an ITERATE step. See Extractors for the full list.

MongoDB is a first-class chain step. A common pattern is HTTP → MongoDB: call an API that creates a record, then run a Find and ASSERT on a MONGO_FIELD value to prove the write. {{variable}} values (including extractor output from earlier steps) resolve into the host, database, collection, and JSON bodies. Credentials resolve server-side at execution.

Each send is recorded as a history entry with the operation as sent (resolved variables), the full result, and a timestamp. Click an entry to restore it.

  • Driver: the official MongoDB Java driver (mongodb-driver-sync). Hand-rolling the wire protocol (OP_MSG framing + a full BSON codec + the SCRAM-SHA-256 handshake) would be a large effort with no fuzzing payoff, so — as with MySQL — a driver is the right tool.
  • Connection pooling: one driver client per connection signature (host/port/database/credential/TLS); the driver pools sockets internally.
  • Documents as JSON: results are captured as relaxed-JSON strings, so they are trivially comparable in ASSERT steps and navigable by MONGO_FIELD without per-type BSON handling.