-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-source-mongodb not fetching Atlas data #38850
Comments
After sleeping on it, I thought to try again with a fresh mongodb cluster and using mongodb example data (sample_mflix dataset). With this, I was able to make a connection using these settings:
So having established a connect to mongodb, I tried again with my data and again it failed. So then I got to thinking my data is too big (±300k items). Turns out, this is likely the problem. When I adjusted my settings to include a query to limit what data I got back, I started getting data:
It appears that the plugin does not support mongodb aggregations, which would be better than the query method (if that's wrong, documentation about using aggregation with this plugin would be great). Additionally, how can a site using this plugin scale to hundreds of thousands / millions of pages if indeed the plugin struggles to pull so much data? Is there another method? Further optimizations? So at this point I'm not 100% sure if this is a bug, or a support request, but I'll leave this here for now. |
Update: I reported this issue while traveling and working with my Apple MBA M2 laptop, now that I am home, I'm trying to continue development on an Apple iMac i7 computer (specs below from
Which is really weird because a) I don't get it on both computers, and b) the URL in that error isn't constructed similarly to the one I am providing: So I have no idea where that error is getting that URL from.
|
Update: I noticed that on the first computer I was running node v18.18.0 and on the second computer I was running node v20.10.0. I changed the node version on the second computer to match the first and now I get a successful build. |
@judsonlmoore what version of MongoDB have you used in MongoDB Atlas? |
@apatel369 MongoDB Atlas v7.0.8 operating in region AWS N. Virginia (us-east-1) on an M0 cluster. |
Preliminary Checks
Description
The
gatsby-source-mongodb
plugin seems not to be working with MongoDB Atlas. That, or I'm just very bad at understanding the documentation (in which case, maybe the documentation needs an explicit config example for Atlas users.The current instructions for
connectionString
lead me to believe that I need to ignore some of the other parameters which are shown in the code examples, but with or without various combinations of my connectionString and the other parameters, I'm not able to establish a connection.I've verified with an 11ty build using
npm mongodb
and with MongoDB Compass on this computer that the connection string I am providing is correct.Mentioning @pieh here since I saw you on recent commits related to this part of the repo. 🙏
Reproduction Link
https://github.com/judsonlmoore/gatsby-temp
Steps to Reproduce
Expected Result
MongoDB data is available in graphql.
Actual Result
Depending on how I try to setup the plugin, I get any combination of these messages:
or
or build process gets stuck on this message
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: