I'm trying to execute a stored function from mongodb-native/node.js environment.
I have several functions inside db.system.js.
It seems Db.executeCommand() is the function but I have no idea how can I pass the function name and the arguments.
I tried db.eval() as suggested but I got the following.
> db.eval('getValue()', {}, function(er,doc) {console.log(er);console.log(doc);});
{ stack: [Getter/Setter], arguments: [ 'send', undefined ], type: 'non_object_property_call', message: [Getter/Setter] }
null
getValue is a simple function that returns an integer.
Anyone has an idea? Thanks.