[SERVER-16070] Add tilde path support to load() Created: 11/Nov/14 Updated: 16/Jan/17 Resolved: 13/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Stennie Steneker (Inactive) | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | neweng, polish | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Participants: | |||||
| Description |
|
The load() command in the mongo shell does not currently support expansion of ~ paths to the current user's home directory:
From the error message it's not entirely obvious why ~ doesn't work. The expectation is that ~ would expand to the equivalent of $HOME similar to shells like bash/zsh (i.e. "/home/user/foo.js"). Tilde paths would be useful for writing mongorc.js add-ins that can load from the user's current path. For scripting purposes, it may also be helpful to expose a getter for the $HOME directory path (eg. getHomePath()). |
| Comments |
| Comment by Justin Cohler [ 13/Jan/17 ] |
|
We are not focusing on new shell features at this point. |
| Comment by Matt Kangas [ 11/Nov/14 ] |
|
This should be straightforward to implement.
Note, in boost::filesystem, neither .absolute() nor .canonical() seem to perform tilde expansion. |