-
카테고리
mongodb 실습
20.08.27 17:48 작성 조회수 27
0
삭제된 글입니다
답변을 작성해보세요.
0
min
질문자2020.08.28
덕분에 문제를 해결하였습니다. 그런데 실행을하면 아래와 같은 문구가 뜨는데 이것은 무슨 이유인가요?
(node:14984) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(node:14984) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.
또한, 사진과 같이 결과가 출력될때 강의중에 말씀하신 {"n":1,"ok":1} 처럼 간단하지 않고 다른 문구들이 붙어서 나오는 것은 다른 이유가 있을까요?
0
박매일
지식공유자2020.08.27
위의 코드부분에서 아래부분의 코드를 찾아서 아래처럼 한번 변경에서 다시해보세요.
mongodb 버전이 혹시 3.0이상을 사용할 때는, connection을 할 때에 database명을 명시해야 될수도 있어서요
mongoDB.connect(url, function(err, database){
console.log("DB Connect.......");
dbObj=database.db("iot");
});
답변 2