events.js:163
throw er; // Unhandled 'error' event
^
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (D:\projects\myblog\node_modules\mongodb-core\lib\topologies\server.js:328:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:191:7)
at Connection.<anonymous> (D:\projects\myblog\node_modules\mongodb-core\lib\connection\pool.js:274:12)
at Object.onceWrapper (events.js:293:19)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:194:7)
at Socket.<anonymous> (D:\projects\myblog\node_modules\mongodb-core\lib\connection\connection.js:177:49)
I guess you have found the reason.
Because MongoDB is not started. Start MongoDB on Windows operating system!
For reference.
Love MongoDB! Have fun!