-
typescript로 mongodb에 접속 예제
//접속 const { MongoClient } = require('mongodb'); const mgct = new MongoClient("mongodb://yourid:password@127.0.0.1:27017"); const db1 = mgct.db("Db1"); const clc1 = db1.collection("Clc1"); //읽기 text (async()=>{ const rst1 = await clc1.findOne({id:"myid1"}); console.log(rst1); })();
'Mongodb' 카테고리의 다른 글
Mongodb Transaction (0) 2023.11.07 Mongodb SSPL 저작권 (0) 2023.11.07 Mongodb Shell 명령어 모음 (0) 2023.01.27 Mongodb javascript.js 파일 불러와 실행 (0) 2023.01.26 Delete (1) 2023.01.13 Update (0) 2023.01.13 drop database, db 삭제 (0) 2023.01.12 Cursor Methods (0) 2022.12.27