목록Web (91)
taenyLog
몽구스(Mongoose)는 Node.js에서 MongoDB와 상호 작용하기 위한 객체 데이터 모델링 라이브러리입니다. MongoDB는 NoSQL 데이터베이스로, 몽구스는 이 데이터베이스를 더 쉽게 다룰 수 있도록 도와줍니다. 몽구스는 MongoDB 스키마를 정의하고, 데이터를 유효성 검사하고, 쿼리를 실행하며, 더 나은 데이터 조작을 위한 여러 기능을 제공합니다. 이를 통해 개발자는 Node.js에서 MongoDB를 사용할 때 강력한 ORM(Object-Relational Mapping) 도구를 사용할 수 있습니다. 깃배쉬(Git Bash)는 Windows 운영체제에서 Git 명령을 실행하기 위한 터미널 에뮬레이터입니다. Git은 형상 관리 도구로서 프로젝트의 버전 관리를 쉽게 할 수 있게 도와주는 도구..
schema(스키마)는 Mongo의 각기 다른 키 집합을 JavaScript의 다른 타입으로 구조를 짜는 것을 말한다. JS나 기타 언어에서 다른 타입인 데이터를 Mongo로부터 가져오지만 그 언어에 데이터 타입이 있을 수도 있고 없을 수도 있다. 스키마를 정의함으로써 구체화한다. https://mongoosejs.com/docs/guide.html Mongoose v7.3.1: Schemas If you haven't yet done so, please take a minute to read the quickstart to get an idea of how Mongoose works. If you are migrating from 6.x to 7.x please take a moment to read ..

mongod가 실행중이어야함. 파워셸을 켜서 PS C:\Users\User> mongod 실행시켰더니 mongoose 연결됨

데이터베이스 개요 https://www.mongodb.com/cloud/atlas/lp/try4?utm_source=google&utm_campaign=search_gs_pl_evergreen_atlas_core_prosp-brand_gic-null_amers-ca_ps-all_desktop_eng_lead&utm_term=mongodb%20database&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624311&adgroup=115749704383&cq_cmp=12212624311&gad=1&gclid=CjwKCAjwhdWkBhBZEiwA1ibLmGOzBYjBXjBwNztMvgWgRPLnNL_ITQX-h3vmRdmQJ0uRpSqYLao6-x..

몽고디비 다운받고 파워셸로 설치가 잘 되었는지 확인해보자 1. 몽고db 사이트에서 커뮤니티 서버 다운 https://www.mongodb.com/try/download/community Try MongoDB Community Edition Try MongoDB Community Edition on premise non-relational database including the Community Server and Community Kubernetes Operator for your next big project! www.mongodb.com path 경로 추가해주기 시스템 > 고급시스템설정 > 고급 > 환경변수 > 시스템변수/path 편집 > mongodb 다운받은 폴더의 bin 경로 추가 2. Mon..
자바스크립트에서 filter는 배열에서 사용하며, 주어진 함수를 만족하는 모든 요소를 모아 새 배열로 반환 .filter() 사용하기 1. .filter()의 () 안에 조건식을 괄호안에 바로 작성 let array = [5,11,9,'string','Hello']; let result = array.filter((value) => value < 10) console.log(result); //array [5, 9] array라는 배열이 있고 10미만의 값 추출을위해 .filter()를 붙히고 괄호안에 필터조건이 되는 함수를 넣었음 . 2. 함수를 만들어 사용 let array = [5,11,9,'string','Hello']; function tenFun(value){ return value < 10 ..

Get 요청 / Post 요청 Get - 요청정보를 가져옴 - get 요청을 보낼 때 따라오는 데이터는 쿼리 문자열에 담김(URL에서 볼 수 있다.) - 백엔드까지 영향을 주진않는다. Post - 정보를 보내거나 올림 - body에 포함 - Json 타입으로 보낼 수 있음 - 생성/ 삭제 / 업데이트 Express Post 경로 정의 Get과 Post를 구별해서 받음 요청 구문 분석하기 다른 포맷으로 데이터를 보낼 수 있다 http://expressjs.com/en/5x/api.html#req.body Express 5.x - API Reference Express 5.x API Note: This is early beta documentation that may be incomplete and is s..