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

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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • manual, Server
    • None

    Description

      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
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              13 weeks, 1 day ago