Hi @John_Page, I am indeed calling this function from either a Mongo Shell or NodeJS app after running loadServerScripts(). I agree with you that it is nothing more than a pipeline definition that’s stored in the database, but that doesn’t make them any less useful / worthy of documentation. To the extent that system.js & loadServerScripts are useful tools provided by MongoDB, they should be well documented: provide the pros and cos of .
In my view stored procedures (whether SQL or no-SQL) can be part of a good database design when used correctly, which is the reason developers like me and @Nadav_Megnazi search google for “MongoDB stored procedures”, and are disappointed by the results. In my view, system.js & loadServerScripts provide the essence of what SQL stored procedures do. E.g any client can call function getUser to load the user, without having to know the mechanics of how the user is stored.
Xavier Robitaille
Feather Finance