gatsby-source-mongodb & options:authSource #31114
Unanswered
Bella-Liu9
asked this question in
Help
Replies: 0 comments
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.
-
Description
I got a problem while using mongodb with auth on the cloud, while using it in the nodejs,the URL need to add an option named authSource,then I failed to connect my database,and the err as below:
But everything was fun when I using mongodb at local.
my URL as below:
mongodb://<USERNAME>:<PASSWORD>@<ADDRESS>:27017/<DBNANE>?authSource=admin
my config while using local db as below:
{ resolve:
gatsby-source-mongodb, options: { dbName:
, collection:
, server: { address:
localhost, port: 27017, }, }, },
my config while using cloud db as below:
{ resolve:
gatsby-source-mongodb, options: { dbName:
, collection:
, server: { address:
, port: 27017, }, auth: { user:
, password:
}, }, },
Beta Was this translation helpful? Give feedback.
All reactions