Open usuario12345679 opened 1 year ago
++ The result coming from the function is an array stored in "res" as coming from mongodb: { _id 6 department : "Automatic". cargo : "Director" name: "D mail: "d***" } The problem is that I don't know how to get from the variable "res" that comes from mongodb, the name and the mail and put it in agent.add to send it to Dialogflow.
A value that is stored in an array (res[0].name) coming from the mongodb database, has to be sent to dialogflow by using agent.add. It turns out that in the visual studio console the value res[0].name appears correctly, but when you add it in agent.add('The name is: '+res[0].name) the result in dialogflow is NOT AVAILABLE. Does anyone know if you need some kind of converter?
Good afternoon I need help because the designed program shown below manages to transfer the information to the consolelog but it is not able to send it to dialogflow through agent.add function. In mongo db database is the information of people with name, department, position and mail. From dialogflow it will receive the position and the department, and the program must be able to search in the mongodb database a person who fullfils those two requirements and send all the information back to dialogflow. I think the key is to use the find() function and then know how to take that information to an array, but I don't know how. Any help is appreciated. (All functions for connecting to moongose are assumed to be OK.)
`function ConsultarDepartament(agent) {