I would like to call functions that I have defined in MongoDB with Meteor.js?
For example I have a function call hi() in MongoDB.
To call it in MongoDB I use this command:
> db.eval('hi()')
What about in Meteor?
var funcInputObj={};var mongoFuncName='testfunc';
MongoInternals.defaultRemoteCollectionDriver().mongo.db.eval('db.loadServerScripts();return ' + mongoFuncName+ '(' + JSON.stringify(funcInputObj|| {}) + ');',function (err, mongoFuncReturnData) {
console.log(mongoFuncReturnData);
});
null in the console.