We can use PostgreSQL or MySQL as DB for keycloak but I want to use mongo DB as database for keycloak. is there any way to implement this ?
Although MongoDB was once supported in Keycloak, it has since been removed. Per the offical Keycloak documentation, a relational database is required for the persistent datastore:
https://www.keycloak.org/docs/latest/server_installation/index.html#_database