[SERVER-1651] Add feature to expose server-side functions in shell Created: 21/Aug/10  Updated: 29/Aug/12  Resolved: 19/Dec/11

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

Type: New Feature Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Kevin Matulef
Resolution: Done Votes: 1
Labels: rn
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DOCS-283 document db.loadServerScripts() Closed
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Add a shell helper command to read and make available the server-side functions defined in the "system.js" collection.

There are a few options:

1.) When you "use database-name" it would read all the functions from the server and define them in the javascript shell.
2.) Add a db.loadServerScripts() function to do 1
3.) Add helper method to the functions to expose them in the shell



 Comments   
Comment by auto [ 25/Jul/12 ]

Author:

{u'date': u'2012-07-24T16:27:16-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}

Message: SERVER-1651 Load server scripts from the database on which 'loadServerScripts' was called, not the global 'db' database.
Branch: master
https://github.com/mongodb/mongo/commit/e0beb0053943af6b7caf4cc6bf5319e089ad03d7

Comment by Kevin Matulef [ 19/Dec/11 ]

Added functionality to implement option 2 above. You can now type db.loadServerScripts to load the contents of db.system.js

Comment by auto [ 19/Dec/11 ]

Author:

{u'login': u'matulef', u'name': u'Kevin Matulef', u'email': u'matulef@gmail.com'}

Message: SERVER-1651 added db.loadServerScripts()"
Branch: master
https://github.com/mongodb/mongo/commit/32f6e84c12607686ef228adfeddd5cdc1e17726e

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