Before I see blog, for example, a custom function:
//define a Sum function
Db. The system. Js. Save ({_id: "Sum",
Value: the function (key, values)
{
Var total=0;
for(var i=0; i
Return the total;
}});
How to call this function
The version 4.2 db. The eval deleted
I call: db loadServerScripts ();
The Sum (1,,2,3,4,5,6,7,8,9 [1])
Error:

So now do not know how to call the custom of the sum function, strives for the bosses to solve
CodePudding user response:
A custom function has been abandoned is not recommended, anyway, now the better tools have affairsCodePudding user response:
Tested in 4.2 no problem