MongoRuntimeError: Unable to parse localhost:127.0.0.1:27017 with URL

Guys I have been taking this Udemy online course “The Complete Web Development Bootcamp” for a while https://www.udemy.com/course/the-complete-web-development-bootcamp. In Section 32, 378th video a simple website is created to explain Authentication and security. So basically when I enter the sample email and password it should take me to a secrets page. But instead I’m getting this mongo runtime error in my terminal after pressing the register button in the register page.

MongoRuntimeError

And I got some error when i ran mongod in my terminal:
msg: Deleted expired documents using index,
attr: namespace:config.system.sessions

Instead of just showing Waiting for connections, attr:{port:27017,ssl:off}

mongod error

My source code from app.js:

app.js
app.js

I already tried sudo rm /var/lib/mongodb/mongod.lock command, but hyper terminal in my pc doesn’t support sudo command. I have also checked my services tab in task manager and the mongoDB server was running perfectly. And someone suggested to download homebrew but that is for MacOS. Can anyone suggest a solution for this in Windows 11 OS?