Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5652

detail the mongo shell startup behaviour related to .mongorc.js

      We should details the mongo shell startup behaviour around the creation of .mongorc.js under a defined directory that varies based on the platform.

      If the .monogrc.js is not found under the specified path selected as per the below mentioned code path in src/mongo/shell/dbshell.cpp, the shell will try to create an empty file. This may fail because the path may not be environment variables may not be appropriately set. In case, this is not specified in the docs, the user will remain clueless on what should be set.

      #ifndef _WIN32
                  if ( getenv( "HOME" ) != NULL )
                      rcLocation = str::stream() << getenv( "HOME" ) << "/.mongorc.js" ;
      #else
                  if ( getenv( "HOMEDRIVE" ) != NULL && getenv( "HOMEPATH" ) != NULL )
                      rcLocation = str::stream() << toUtf8String(_wgetenv(L"HOMEDRIVE"))
                                                 << toUtf8String(_wgetenv(L"HOMEPATH"))
                                                 << "\\.mongorc.js";
      #endif
      

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            anil.kumar Anil Kumar
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 24 weeks, 3 days ago