How to query nested RASA event data | Mongo DB

Hi There

I am building a RASA chatbot for my organisaton. I have a couple of usecases covered in it. Just assume that I have a welcome screen which suggests the consumer 3 options A, B & C. With each of those options there is a a further dialogue flow which is purely user intent based and there are bot actions / utterances purely basis what the user writes (intents).

Now I basically want to know that how many a times in a day are each of those options A, B & C selected by the user. Simple Analytics.

However, when I check a single object (for a conversation) getting created in my Mongo DB, it is very complex (nested).

The root node of the json contains the event level data and within each event we have the intent level data. The names A, B & C are passing at the intent level. If they would have been passing at the event level, then job would have been easier. What we get in events is action, user, etc.

To conclude : Questions is How can I know how many a times in a day are each of those options A, B & C selected by the user.

If you’re using Python, one option would be to import the relevent time slices of your database, flatten it (here’s a blog post on flattening a json that may be helpful) and then use pandas to run your analysis.

You might could also try mapreduce, especially if your database is bigger.