Replies: 2 comments 1 reply
-
Hey @nwhitmont , thanks for the report. This definitely should be something we document. I'll convert this to a discussion, and we can continue there. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@nwhitmont Have you tried using the solution from this discussion? #652 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Documentation Issue
Hello, I am looking for a working example of how to connect Payload to AWS DocumentDB with TLS enabled & certificate file.
Following this guide:
https://docs.aws.amazon.com/documentdb/latest/developerguide/connect_programmatically.html#connect_programmatically-tls_enabled
Additional Details
For example, using connection string:
'mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/?tls=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false'
and config options:
mongoOptions: { tlsCAFile: fs.readFileSync(__dirname +'/certs/rds-combined-ca-bundle.pem').toString(), },
Where certs in
payload-app/src/certs
I keep getting errors like:
17:50:57] ERROR (payload): Error: cannot connect to MongoDB. Details: MongoDB prohibits index creation on connections that read from non-primary replicas. Connections that set "readPreference" to "secondary" or "secondaryPreferred" may not opt-in to the following connection options: autoCreate, autoIndex
Also found this SO post, but the OP said they eventually gave up and used Mongo Atlas instead of AWS
https://stackoverflow.com/questions/72480395/connecting-to-aws-documentdb-using-mongoose-giving-error-mongoparseerror-opti
It would be nice to include a working example of connecting to AWS DocumentDB in the documentation if it is a supported feature.
Thanks in advance for your help on this one!
Beta Was this translation helpful? Give feedback.
All reactions