Backend/nodejs
-
[nodejs]smtpBackend/nodejs 2024. 3. 4. 22:38
$ npm i nodemailer-smtp-pool nodemailer import nodemailer from 'nodemailer'; import smtpPool from 'nodemailer-smtp-pool'; const config = { mailer: { service: 'Gmail', host: 'localhost', port: '587', user: process.env.SMTPUSER, password: process.env.SMTPPW, }, }; const from = `sss ` const html = `내용`; const subject = '메일 이름' const mailOptions = { from, to, subject, html, ..
-
mongodb 명령어Backend/nodejs 2023. 1. 26. 11:28
show dbs; 데이터 베이스 생성 use [데이터 베이스명] 데이터 베이스 이름 확인하기 [데이터 베이스명] 데이터 베이스에 넣기 db.[컬렉션 이름].insert(document 내용) 안에 정보를 넣어야 데이터 베이스를 확인할 수 있다. show dbs; 컬렉션 이름 확인하기 컬렉션 내용 확인하기 db.[컬렉션 이름].find() 컬렉션 내용 query 조회 - db.[컬렉션 이름].find({검색할 내용}).pretty() 여기서 검색할 내용은 쿼리문을 사용해서 한다. 간단한 조건은 그냥 사용하면 된다. db.book.find({"author":"yuyu"}) 이걸 통해 대소문자를 구분함을 알 수 있다. 만약 여기서 숫자가 있다면 db.[컬렉션명].find({"항목":{$lte:20}) 이렇게도..