MongoDB & Redis
The non-SQL engines get their own runners, shaped to their data model rather than forced into a table grid. Browsing both is covered in Browsing your data; this page is about running commands.
Both runners require the Editor role and are recorded in the db_query_log audit table.
MongoDB — the Mongo Shell
Section titled “MongoDB — the Mongo Shell”The Mongo Shell runs an arbitrary mongosh script against the selected database. It’s a collapsible panel below the collection browser, closed by default.
- Pier prefixes your script with
db = db.getSiblingDB("<selected database>"), sodbrefers to the database you picked — then runs the rest verbatim. - Scripts execute through
mongoshinside the service container (via docker-exec), authenticating as the root user from the service’s encrypted env. There’s no native Mongo driver in the Pier binary. - The shell’s textual output is returned as-is, so
print(...),printjson(...)and the implicit result of an expression all show up.
Example scripts:
// count documents in a collectiondb.getCollection("orders").countDocuments({ status: "paid" })
// find with a projectiondb.getCollection("users").find({ active: true }, { email: 1 }).limit(5).toArray()
// an aggregationdb.getCollection("events").aggregate([ { $group: { _id: "$type", n: { $sum: 1 } } }, { $sort: { n: -1 } }]).toArray()For read-only browsing (databases, collections, paginated documents as EJSON) you only need Viewer — see Browsing your data.
Redis / Valkey — the command box
Section titled “Redis / Valkey — the command box”The Redis view pairs the key browser with a command box that runs a single raw command and renders the reply as JSON.
- Type a command like
GET mykey,HGETALL session:42orTTL token:abcand run it. - The command line is tokenized with double-quote support, so
SET greeting "hello world"keeps the quoted argument intact. - Replies are converted to JSON: bulk strings, integers, arrays/sets, maps and
OKall map to their natural JSON shape. - The selected database index (0–15) applies to the command, the same as the key browser.
Reads through the key browser (SCAN, type-aware GET/LRANGE/HGETALL/…, TTL) need only Viewer; running an arbitrary command needs Editor, since a command can mutate or delete data.
Next steps
Section titled “Next steps”- Access & audit — roles and the
db_query_logaudit log. - Overview — supported engines and how Pier connects.