전체 글
-
MongoDB, Mongoose and NoSQLJavascript/Node.js and Express 2021. 7. 15. 17:38
App.js const mongoose = require("mongoose"); //User라는 스키마불러오기 const User = require("../models/user"); //저장할 db위치, 이름, 접근 등 설정 mongoose.connect("mongodb://localhost:27017/admin", { useNewUrlParser: true, useUnifiedTopology: true, user: 'test', pass: 'test', }); mongoose.set("useFindAndModify", false); mongoose.set("useCreateIndex", true); //연결에러시 콘솔에 에러 띄우기 const db = mongoose.connection; db.on("..
-