[SERVER-1687] Mongo shell reads a defaults file on startup Created: 26/Aug/10  Updated: 12/Jul/16  Resolved: 21/Jul/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 1.9.1

Type: Improvement Priority: Major - P3
Reporter: Kenny Gorman Assignee: Matt Dannenberg
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Participants:

 Description   

alter mongo shell to read a defaults file on startup. This allows users to customize the environment, create functions, etc in the shell. This could be similar to a .bashrc file, or a login.sql in sqlplus, or /etc/psqlrc and then from $(HOME)/.psqlrc in PostgreSQL. It would be nice if it checked the working dir first, the a default spot after that.



 Comments   
Comment by Matt Dannenberg [ 21/Jul/11 ]

if a file named .mongorc.js is found in the home directory, it will be run on start up
if the shell is launched with the --norc, the file will not be read

Comment by auto [ 24/Jun/11 ]

Author:

{u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: Merge pull request #53 from dannenberg/initrcyetagain

SERVER-1687 .mongorc.js file is read from home directory on shell startup
Branch: master
https://github.com/mongodb/mongo/commit/c8a737a22e8a94b9b942fc4b0ddcf76063bc97c2

Comment by auto [ 24/Jun/11 ]

Author:

{u'login': u'dannenberg', u'name': u'dannenberg', u'email': u'dannenberg.matt@gmail.com'}

Message: SERVER-1687 .mongorc.js file is read from home directory on shell startup
Branch: master
https://github.com/mongodb/mongo/commit/d3d1f3242710fcc4f9707d9febae3e9e2d176b83

Comment by auto [ 24/Jun/11 ]

Author:

{u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: Revert SERVER-1687 for now

This reverts commit 24fdf9b1a1a63c7ac89c5e6441010db0bda30f50.
Branch: master
https://github.com/mongodb/mongo/commit/fcdf4115ac92553cfc59d23fab78549ef69c4dda

Comment by auto [ 24/Jun/11 ]

Author:

{u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: Merge pull request #49 from dannenberg/initrccorrect

SERVER-1687 .mongorc.js file is read from home directory on shell startup
Branch: master
https://github.com/mongodb/mongo/commit/5997c64e4bac9353f5a00c99e23016537808a908

Comment by auto [ 24/Jun/11 ]

Author:

{u'login': u'dannenberg', u'name': u'dannenberg', u'email': u'dannenberg.matt@gmail.com'}

Message: SERVER-1687 .mongorc.js file is read from home directory on shell startup
Branch: master
https://github.com/mongodb/mongo/commit/24fdf9b1a1a63c7ac89c5e6441010db0bda30f50

Generated at Thu Feb 08 02:57:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.