On this page
mongosh checks your
HOME directory for a
mongosh reads the content of .mongoshrc.js before
displaying the prompt for the first time.
If you use
expression, either by using the
on the command line or by specifying a .js file,
mongosh reads .mongoshrc.js
.mongoshrc.js from being loaded by using the
You can use the .mongoshrc file to customize
behavior and add scripted functionality. For examples, see
Execute Code From a Configuration File.