profile image

L o a d i n g . . .

 

Mongoose v7.0.1: Getting Started

First be sure you have MongoDB and Node.js installed. Next install Mongoose from the command line using npm: $ npm install mongoose --save Now say we like fuzzy kittens and want to record every kitten we ever meet in MongoDB. The first thing we need to do

mongoosejs.com

const mongoose = require('mongoose');

main()
  .then((fulfilled) => console.log(fulfilled))
  .catch((err) => console.log(err));

async function main() {
  await mongoose.connect('mongodb://127.0.0.1:27017/test');
}

몽구스 퀵스타트 보면서 위처럼 적었더니

 

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

라는 에러가 빵빵 떴다.

 

왜일까 싶어서 생각해보니 

npm i mongoose만 하고 몽고디비를 설치하지 않았다.

 

나.. 대단해^^... 몽고디비없이 몽고디비 부르고있으니 커넥션 에러가 뜨는게 당연하다.. (댕청)

반응형
복사했습니다!