Error connecting to mongodb with custom action

HI, I tried to use custom action to get Q&A data from mongodb, but rasa got the following error

Here is my actions.py

Can you tell me where I am wrong and help me to fix it, thanks :cry: