|
There has been several tickets about how to upload a working library to the server, like:
http://stackoverflow.com/questions/8418651/techniques-for-storing-libraries-in-mongodbs-system-js
Turns out this is automatically done in v8: it will always run code as it is loaded.
If you save:
db.system.js.save({ _id: "mylib", value: "myprint = function()
{ print('installed'); return 'installed';" }
Then you can use myprint() freely in your code
With spidermonkey it is not done.
We should standardize and make it so that:
- by default code does not get run
- if there is a flag set on the object "run: true" then run it as it is installed on context.
|