I am trying to design a chatbot that stores its chat history in mongo. For example, if a user in slack asks the question ‘I need help with vpn’ the bot will respond to that message with helpful information, it will then ask if it was helpful and they have buttons to select yes or no. I want mongo to be able to store that information in a collection for what the bot heard, time timestamp, and if the user selected the yes/no button. I am using model.findOneandUpdate() but that only seems to update the first item in the collection, not the current message/collection.
Maybe there is a better way to do what I am trying to do. I am using node.js to handle the bot.