Actually I have to use external database. So I have created a mongodb pod using stateful sets.
Currently I am using the connection string as -
Can anyone pls guide about the correct format of the connection string.
Could you please refer to the official k8s blog post for mongodb to verify your setup.
If you have configured the statefulset’s and the headless service correctly, then your connection string seems correct, but I think you have to escape _ with a backslash.