I was just giving you the true process you’d use to connect to your db, however in this case glitch takes care of your env file, If you correctly set the connection string in the .env file of your glitch app then you can just use process.env.MONGO_URI
to connect to your db, again look at that lesson I linked above on how to correctly set your env variables.
Right now you have hardcoded your connection string, which you shouldn’t do, also your connection string is wrong, your app passes for me with a working connection string,
see here how to correctly connect to the new mongoDB atlas: