I have been trying to pass this test for hours now. I have tried every solution possible and it still isn’t working. Keep on getting “mongoose is not connected.” Please help!
Here’s my code:
myApp.js
var mongodb = require('mongodb');
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGO_URI);
remove that part from the end your connection string and try it, I’m looking into why that is being added to the end of the connection string, this is the second time I have now seen this.
I’m not sure if it is glitch that is causing this issue with the write concern or a driver issue or something else, but atlas just recently added it to the end of the string, it was not this way a couple weeks ago, If somebody could try connecting to the string locally we can verify that at least it is not glitch, if it is glitch then maybe the template can be changed
edit: @isheetac I have edited your title to merge other future threads into this with the same issue so we can target it better, thanks.
@camperextraordinaire, just ‘atting’ you since you are most familiar with this issue here, there maybe a modification that mongodb atlas made in the connection string in the last few weeks that prevents users from connecting with glitch, it is resolved by removing the &w=majority from the end of the connection string, but I’m not sure yet of the cause or what could be a perma-fix.
I can’t say without looking at your glitch link, and even then it is likely that it is an issue with the way you got your connection string rather than glitch itself, I have confirmed however that you must remove &w=majority for it to work , haven’t had the time to figure out the why’s and hows for the moment.