-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
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