I am trying to fetch data from mongoDB using graphql and Meteor. Unfortunately it returns null for some fields where there is a value in the database. This is only happening in Production and Staging environments, which are hosted at mongoDB Atlas. The exact same query is returning the value correctly when connected to a local mongoDB instance. This issue persists when we have the same code deployed on a server at Meteor Galaxy. Has anyone experienced something similar? I would really appreciate it if anyone could help.
It may be helpful to check the relevant DB fields to make sure they are declared identically on dev and prod.
They are same. please note it works in dev environment.
Hi @muhammadpedalme, you said that you’re able to get the values on your local MongoDB instance. Do the fields you’re fetching on your Atlas instance exist there? And did you add value to them? Because it seems to me you’re fetching empty fields and that’s why they’re null…
I have experienced this and that’s why I run my own servers and do not ever pay for a hosted solution because they just don’t work and the support sucks plus they are incredibly expensive.
Buy a server, install mongo and never face this kind of issue again. If you always RTFM and never expect customer support to be able to help, you wont ever find yourself in this clutch.
Keep it old school, we never had services back then, avoid it, do not buy services that are free to run its a mind tax and under GNUGPL its hypocritical, as these tools are designed by the community to be open source, they are not SaaS services, the code is free to obtain. Just get a coffee and read the manual. It was made for you to use for 100% free
If you can without running any mutations, consider connecting your dev environment to your production DB and see if you can replicate the anomaly that way. If so you may be able to capture some info on what’s causing it.
thak you for the replay, i have tried that.it exits there as well. the problem i am facing now is i cant console log the result of query. no output is printed at the terminal when i am connecting to production DB. wierd.
NoSQL Manger for MongoDB has a schema analyzer that can tell you if you have any inconsistent or null values in your collections. Maybe you can try to run that against your prod and local DB and compare the results.
Good idea I use Robo 3T it’s really good for this
Connect via Robo and see wtf is up with it, maybe you are not using the correct DB on the server or maybe you don’t have user permissions to select from it