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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • # Replies:
      1
    • Last comment by Customer:
      true

      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

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since reply:
                3 years, 31 weeks, 1 day ago
                Date of 1st Reply: