Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何调用来自mongodb的函数_Node.js_Mongodb_Mongodb Query_Robo3t - Fatal编程技术网

Node.js 如何调用来自mongodb的函数

Node.js 如何调用来自mongodb的函数,node.js,mongodb,mongodb-query,robo3t,Node.js,Mongodb,Mongodb Query,Robo3t,这是我的机器人文件 { "_id" : ObjectId("##########"), "actionname" : "testaction", "actiontype" : "database.action", "isshortworkflow" : true, "processstartedmessage" : "", "databaseUserName" : "####", "databasePassword" : "", "queryTemplate" : "Select * from

这是我的机器人文件

{
"_id" : ObjectId("##########"),
"actionname" : "testaction",
"actiontype" : "database.action",
"isshortworkflow" : true,
"processstartedmessage" : "",
"databaseUserName" : "####",
"databasePassword" : "",
"queryTemplate" : "Select * from shop where name=parameters.get("itemName")",
"databaseType" : "MYSQL",
"resultTemplate" : " parameters.get("itemName") + 'has quantity of' + result[0].get('quantity')"
}
这里queryTemplate字段的name=parametres.get(“itemName”)。这是我的java代码中的一个本地函数,将作为“item1”返回。问题是,因为它将来自mongo db,所以它不会执行parameters.get(“itemName”)函数。有没有一种方法可以使用从mongodb返回的字符串来执行函数。如何在mongodb内部实现