As the title says. I've tried to google this line but it brings back like 4 results only and none are useful.
This is how I connect to my mongoDB server
import mongoose from "mongoose";
mongoose.connect(`${process.env.MONGODB_URI}`);
And this is my URI:
mongodb+srv://MY_USERNAME:[email protected]_ID.mongodb.net/ORGANIZATION_NAME?retryWrites=true&w=majority
And then just require his in my index file.
What am I doing wrong to get this issue?
Ok I figured it out. When copying my URI into Railway's env variables, something went wrong and it only copied the uri up to
retryWrites
, leaving out everything after (=true&w=majority
). SoretryWrites
was the option with no value it talked about.