How to store users from cognito to mongoDB

In practice. I have learned about Cognito that stored data to dynamo DB.
I want to try storing that data to MongoDB. How doing that?

Hmm I’m not entirely sure what you mean. What would you like to store in Mongo?

because in cognito, there is no ‘role’ attributes. i want to add ‘role’ attribute foreach user. for example: i have role like ‘admin’ and ‘customer’. Admin can access the entirely the features. And customer not all access.

So you want to continue using Cognito for authentication but store these roles in Mongo?

yes. so is there alternative step or tricks?