Using MongoDB Java driver v5.1, I can connect to the MongoDB cluster and query a document successfully from a Java main method. However, querying a document from MongoDB for Karate test gives the error: Failed looking up TXT record for host cluster-name.xxx.mongodb.net
. My connection string is in the format: mongodb+srv://<username>:<password>@cluster-name.xxx.mongodb.net/?retryWrites=true&w=majority
.
What is the correct way to connect to MongoDB from Karate? I am using Karate v1.4.1 & Java 17.
iros is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.