There are a certain number of customization options you can perform on the mongo shell. Simply by creating a .mongorc.js file (https://docs.mongodb.com/manual/reference/program/mongo/#mongo-mongorc-file) in your user home directory, you can customize the prompt to display dynamic information such as the uptime, hostname, database name, number of commands executed, and so forth. This is accomplished by defining a JavaScript function to the prompt reserved variable name, whose return value is echoed to form the prompt.
You can also make the mongo shell prompt global by creating the file as /etc/mongorc.js.
Here is a sample .mongorc.js script that displays the MongoDB version, hostname, database name, uptime, and command count:
host = db.serverStatus().host;
cmd = 1;
prompt = function () {
upt = db.serverStatus().uptime;
dbn = db.stats().db;
return "\nMongoDB " + host + "@" + dbn
+ "[up:"...