[DOCS-2519] Comment on: "manual/tutorial/store-javascript-function-on-server.txt" Created: 11/Jan/14  Updated: 03/Nov/17  Resolved: 15/Oct/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/manual/tutorial/store-javascript-function-on-server/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.22 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1280 x 800
repo: docs
source: tutorial/store-javascript-function-on-server


Participants:
Days since reply: 10 years, 5 weeks, 5 days ago

 Description   

"Note We do not recommend using server-side stored functions if possible."

It would be great if the doc said why!



 Comments   
Comment by Tony Pujals [ 11/Jan/14 ]

It looks like others people wonder about this as well. There ought to at least be a link to a page that provides a more detailed reason why. While it's not hard to come up with possible reasons why it might not be recommended, it would be better if a rationale was provided, allowing people to decide for themselves if the reasons are important to them or not in their particular situation. After, if a feature is available, then there probably are some scenarios in which it makes sense.

http://stackoverflow.com/questions/18853120/not-recommended-to-use-server-side-functions-in-mongodb-does-this-go-for-mapred

This next SO question has a response at the bottom that provides something of an explanation by quoting Mongo documentation, but the link doesn't point to a page anymore with the quote, leading one to wonder if perhaps the recommendation no longer applies.

http://stackoverflow.com/questions/13841253/to-write-js-from-server-side-in-mongodb

Strengthening that argument is that new in version 2.1 in the mongo shell, you can use db.loadServerScripts() to load all the scripts saved in the system.js collection for the current database. Once loaded, you can invoke the functions directly in the shell.

Generated at Thu Feb 08 07:43:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.