====== Quick Setup ====== For a quick setup with m and mtools on Debian/Ubuntu, download a script [[https://github.com/nitredd/provisioning/raw/refs/heads/master/mongo-playground-deb.sh|here]]. npm install -g m # Aaron Heckmann's verion manager # m 8.0.15 # m mongosh 2.5.9 # m tools 100.13.0 # PATH=$PATH::~/.local/m/tools/versions/100.13.0/bin:~/.local/m/shell/versions/2.5.9/bin:~/.local/m/versions/8.0.15/bin python3 -m pip install mtools psutil pymongo # Thomas Rucksteiss' mtools # mlaunch --init --replicaset --nodes 1 --sharded 2 --port 28000 # mongosh --port 28000 ====== Key-file login ====== mongo -u __system -p "$(tr -d '\011-\015\040' < path-to-keyfile)" --authenticationDatabase local ====== MongoSH JSON ====== To increase the levels of JSON nesting to display (from the default of 6), run the following: config.set("inspectDepth", Infinity) ====== Tuning for writes ====== db.adminCommand({ setParameter: 1, wiredTigerEngineRuntimeConfig: "eviction_dirty_target=2,eviction_dirty_trigger=30,eviction_updates_target=2,eviction_updates_trigger=30,eviction=(threads_min=8,threads_max=8)" }) Also consider increasing: https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-storage.journal.commitIntervalMs