Getting mongoose.connect error

const mongoose = require(‘mongoose’)
Error: Invalid mongodb uri “mongodb+srv://”. Must begin with “mongodb://”

i am using this code to connect my glitch app to mongodb atlas and I have been getting error (Must begin with “mongodb://”). Can somebody help me with connection of atlas to glitch app.

I think the issue is with the +srv you’ve added here. Have you tried using mongodb://

No i didnt try. As of now the error has been corrected. I just had to update mongoose to the latest version.
npm update mongoose. Thanks for the suggestion.

1 Like