How to encrypt mongo db data?

Hi @Deepak_Maharana,

My previous comment has links to relevant documentation.

Encryption at Rest is configured on the MongoDB server and does not require any client or driver parameters.

If you have also configured TLS Network Encryption (always recommended), then you will have to provide appropriate certificates to connect from a client/driver.

The MongoDB Security Checklist has a helpful overview of security measures you should implement to protect your MongoDB installation.

What specific version of the Java driver are you using and what is the error message?

Were you able to connect with the Java driver before making server configuration changes?

Regards,
Stennie