I am trying to set up MongoDB with Node.js and I keep getting the following error:
Uncaught MongooseServerSelectionError MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
at MongooseError (c:\Users\lilpi\mongo\node_modules\mongoose\lib\error\mongooseError.js:7:1)
at MongooseServerSelectionError (c:\Users\lilpi\mongo\node_modules\mongoose\lib\error\serverSelection.js:26:1)
at Connection.openUri (c:\Users\lilpi\mongo\node_modules\mongoose\lib\connection.js:824:32)
at <anonymous> (c:\Users\lilpi\mongo\node_modules\mongoose\lib\index.js:381:10)
at <anonymous> (c:\Users\lilpi\mongo\node_modules\mongoose\lib\helpers\promiseOrCallback.js:41:5)
at promiseOrCallback (c:\Users\lilpi\mongo\node_modules\mongoose\lib\helpers\promiseOrCallback.js:40:10)
at Mongoose._promiseOrCallback (c:\Users\lilpi\mongo\node_modules\mongoose\lib\index.js:1234:10)
at Mongoose.connect (c:\Users\lilpi\mongo\node_modules\mongoose\lib\index.js:380:20)
at <anonymous> (c:\Users\lilpi\mongo\app.js:3:10)
at Module._compile (internal/modules/cjs/loader:1126:14)
at Module._extensions..js (internal/modules/cjs/loader:1180:10)
at Module.load (internal/modules/cjs/loader:1004:32)
at Module._load (internal/modules/cjs/loader:839:12)
at executeUserEntryPoint (internal/modules/run_main:81:12)
at <anonymous> (internal/main/run_main_module:17:47)
Here is my code:
const mongoose = require('mongoose')
mongoose.connect('mongodb://localhost:27017/mongotest')
Here is my database connection:

This is my first time attempting to use MongoDB and I am very new to node.js and programming as a whole, so the solution is probably very obvious.