[SERVER-2124] Add the equivelent of an include/import or classpath functionality Created: 19/Nov/10  Updated: 03/Feb/17  Resolved: 03/Feb/17

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

Type: New Feature Priority: Trivial - P5
Reporter: David Boyd Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

The shell is extremely useful for prototyping and developing server side
scripts including map/reduce or other long running data manipulations
without the need for a separate language or scripting environment.

However, there is currently no easy way (at least that I could find) to
easily pull in libraries of java script functions for repetitive tasks.

Adding the equivalent of #include to pull in function/structure or other
definitions from external files or a classpath type argument so that
such functions could be searched for and loaded at runtime would
round out the console shell into a robust testing and data manipulation
tool.



 Comments   
Comment by Mira Carey [ 03/Feb/17 ]

The shell automatically loads js from ~/.mongorc.js

Additionally, other files may be loaded with load()

Comment by Eliot Horowitz (Inactive) [ 20/Nov/10 ]

I think there's already a case for a ~/.mongoshell type file.
And you can use load()

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