A collection of MongoDB scripts and command notes.
Live scripts are in src/. They run under mongosh 1.10 / 2.10+ (mongosh --file and load()). Read the disclaimer before running anything outside a test environment.
src/— operator scripts for storage, deletes, schema, latency, and cluster checks.- DB Storage tools — WiredTiger disk use. dbstats reports it. autoCompact, onlineDefrag, and indexCacheUtil act on or inspect the same storage.
- mongosh scripting guide — read preference, sessions, async, and
--evalbehaviour that long-running scripts keep hitting. - Roadmap — planned work, plus the live and archived version of each script.
- Aggregation tips — pipelines for a rolling date window, oplog churn, and schema shape.
- Howto: streaming sort — keep an ordered walk streaming, as niceDeleteMany does when it buckets
_idvalues. - Roll your own SRV records — publish TXT and SRV records for
mongodb+srv://in a zone you control.
- TLS/SSL commands — OpenSSL commands for MongoDB certificates, Atlas CAs, ciphers, and x509 cluster auth.
- FIPS enablement — regenerate a certificate so the key and signature meet FIPS.
- Kerberos commands — keytab export, delegation tests, and S4U.
- Kerberos MIT/AD interoperability — enable AES and build an Active Directory service keytab.
- LDAP anon bindings — an anonymous bind leaves
queryUserandqueryPasswordunset.
- Split-Horizon Topology testing — stand up a replica set with split horizons and check the external names.
- BI Connector reproductions — mongosqld 2.13.1 startup and MySQL connection strings, with and without SSL and auth.
- DNS over HTTPS — turn on DNS over HTTPS on macOS, including a local resolver on port 53.
- VM ballooning detection — detect the hypervisor and whether a ballooning driver is present.
- Client handshake metadata — driver monitoring sockets, and the
NetworkInterfaceTL-*andMongoDB Internal Clientlabels.
- Atomic backups using
fsyncLock()— which single-mongod file backups are consistent, through 9.0. - Compressor analysis — how network compressors behave across message size and payload entropy, with a chart per carrier.
- Sweet32 protection in Ops Manager (Java) — historical Ops Manager deny list for 3DES. Do not add it on a current Ops Manager.
- Command tool tips — process and network commands used alongside these notes.
The last dual-shell (mongo / mongosh) tree is the legacy mongo shell snapshot, cut 2026-09-01 at tag legacy-mongo-shell. It is unmaintained. Pair those files with archived mdblib.js v0.15.10.