강의에서 socket.id는 계속 유지되다가 연결이 끊기거나 새로고침되면 바뀐다고 나오는데요 즉, 새로고침하면 소켓연결이 끊긴다는 뜻인데 이걸 막을 방법이 있나요? 예를 들어서 제가 웹 상에서 멀티플레이가 가능한 카드게임을 구현한다고 하면 게임 플레이 도중 사용자가 실수로 새로고침을 누르면 끊겨버릴텐데 이런 상황에서는 어떤식으로 처리를 하나요? 또 질문이 하나 있는데 강의와는 조금 벗어난 질문이긴한데.. 소켓연결에 더해서 redis까지 이용해서 만들어보려고 하는데 구글에 nestjs redis 이렇게 검색하면 나오는 공식문서가 Microservice 어쩌고 하면서 redis랑 같이 나오더라구요. 제가 구현하고 싶은 기능은 웹상에서 방을 만들고, 사용자들이 해당 방에 들어가면 사용자들의 정보를 redis에 담고 redis pub/sub과 소켓을 이용하여 같은 방안에 사용자들끼리 통신하는 그런걸 만들어보고 싶은데 이 경우에 공식문서에 나와있는 Microservice.. 를 쓰면 되는게 맞는건지 잘 모르겠어서 질문드립니다.
친절한 답변에 항상 감사드립니다. 아래 질문이 두가지 있습니다. 바쁘시겠지만 확인 하시면 답변 부탁 드리겠습니다. 1. User.js의 아래의 save()는 실제 DB에 저장을 하는겁니까 user . save ( function ( err , user ) { if ( err ) return cb ( err ) cb ( null, user ) } ) 2. User.js의 generateToken에서 아래와 같이 user._id의 값을 불러왔는데 이 값은 this 객체에는 설정이 안된 값인데 DB에서 자동으로 생성된 값을 어떻게 불러올수 있는지요? var user = this; var token = jwt . sign ( user . _id . toHexString () , ' secretToken ' ) ;
mysql을 사용하여 진행 중인 프로젝트가 있는데 tdd를 적용해보려고 합니다. controllers/subscription.js const db = require('../routes/database.js'); exports.subscribeCalendar=()=>{}; 컨트롤러 코드는 위와 같고 test/unit/subscription.test.js const subscriptionController=require("../../controllers/subscription") describe("캘린더 구독",()=>{ test("subscribeCalendar 함수가 있을 겁니다.",()=>{ // subscriptionController.subscribeCalendar의 타입은 함수다. expect(typeof subscriptionController.subscribeCalendar).toBe("function") }) }) 테스트 코드는 위와 같은데 컨트롤러에서 db를 임포트 하기 전에는 에러가 안 떴는데 임포트 한 후에 테스트는 통과하지만 아래와 같은 에러 메시지가 뜹니다. 검색해보니 단위테스트 할 때는 db 관련 코드는 넣지 말라고 하는데 그 원인일까요? ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. 이미 mysql로 진행 중이라 몽구스로 변경하기가 어려운데 에러메시지 무시하면 될까요..?
안녕하세요! 좋은 강의 잘 듣고 있습니다. 다름이 아니라 질문이 있어 글을 남깁니다. 이미 User.js에서 age: Number로 설정해두었기 때문에 숫자 외의 것이 들어온다면 catch문에서 제대로 에러 처리가 될 것 같은데, 따로 라우트 내에서 age가 숫자인지 아닌지를 다시 체크하는 이유가 궁금합니다. 감사합니다!
[리뉴얼] 처음하는 MongoDB(몽고DB) 와 NoSQL(빅데이터) 데이터베이스 부트캠프 [입문부터 활용까지] (업데이트)
Mac M1에서도 mongodb 설치할 수 있는 튜터리얼 만들어주시면 감사하겠습니다. 선생님 강의 보면서 재미있게 따라하고 있는 수강생입니다. 그런데 제가 mac M1으로 바꾸었는데 그대로 따라할려고 하다보니 path도 꼬이고 유튜브나 블로그에서도 약간 중구난방식으로 설명이 된거 같아서 선생님께서 mac유저 앞으로 향후 M1사용자가 증가될 것이 자명하기 때문에 추가로 튜터리얼 작성해주시면 감사하겠습니다. 다른 설명 따라할려고 하는데 터미널쪽하고는 전혀 친하지 않아서... ㅜㅜ
제가 이 강의의 기초강의인 코로나맵1을 안듣고 바로 2를 들어서 그런지 모르겠지만.. 아직 만들지도 않은 tag들에 CSS를 적용 하고 API들의 기능들에 이런저런 설명도 하나 없고~ 너무 따라치세요~ 식 강의 아닌가요? 이 강의 5분 들으면 공식문서 뒤져서 id네임은 꼭 저렇게 쓰라고 정해진건지~ map div에 style은 꼭 인라인으로 써야하는 건지 Event는 뭔지, 왜 addEventListener가 아니고 addListener인지 이거저거 하나하나 뒤져가면서 진도를 나가고 있습니다. 이거 강의가 5만원가까이 되는걸로 기억하는데 결과물은 어떨지 모르겠으나 강의 내용이 너무너무 부실하네요!!
안녕하세요 제로초님! 같이 프로젝트를 진행한 동기가 말하기를 "서비스에 join 작업이 많은 데이터의 반복적인 요청이 많을때에는 lazy loading 이슈가 있을 수 있기 때문에 mongoDB를 사용하는게 좋다" 고 하는데... 이게 무슨 말인지 잘 모르겠습니다. mysql에서 join한 데이터를 반복적으로 조회하는게 lazy loading 이슈가 있을 수 있다는 건 이해가 되지만, mogoDB도 mongoose의 populate를 사용하기 때문에 똑같이 lazy loading 이슈가 있을 수 있는거 아닌가요?
안녕하세요 좋은 강의 잘 듣고 있습니다. Postman으로 회원 정보를 localhost:5000/register api에 test하는 부분에서 send를 누르고 200 Ok가 뜰 때 User 회원정보가 몽고디비에 insert된건지, 아니면 postman에서 임시로 테스트하는 것이므로 insert가 된 것이 아닌지 궁금합니다. 만약 유저가 insert가 이루어졌다면 몽고디비 클라우드에서 User 명단을 어디서 조회할 수 있을까요? + 추가로 github에 commit할 때 index.js에 몽고디비 비밀번호가 그대로 실릴텐데 이걸 따로 .gitignore파일에 담게할 수는 없을까요? 클러스터 비밀번호는 강의랑 똑같이 하여 지금은 상관없을 듯 한데, 나중에 개인프로젝트 같은 걸 할 때 어떻게 할지 궁금합니다 감사합니다!
./src/_reducers/user_reducer.js Line 11:13: Unreachable code no-unreachable Line 14:13: Unreachable code no-unreachable Line 17:13: Unreachable code no-unreachable ./src/hoc/auth.js Line 2:8: 'Axios' is defined but never used no-unused-vars Line 33:12: React Hook useEffect has missing dependencies: 'dispatch' and 'props.history'. Either include them or remove the dependency array react-hooks/exhaustive-deps ./src/components/views/LoginPage/LoginPage.js Line 2:8: 'Axios' is defined but never used no-unused-vars ./src/components/views/RegisterPage/RegisterPage.js Line 4:8: 'Axios' is defined but never used no-unused-vars ./src/App.js Line 6:3: 'Link' is defined but never used no-unused-vars Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before. [HPM] Error occurred while trying to proxy request /api/hello from localhost:3001 to http://localhost:5000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) [HPM] Error occurred while trying to proxy request /api/users/auth from localhost:3001 to http://localhost:5000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) 터미널에 이렇게 뜨면서 시작을 하고 시작페이지와 버튼만 출력됩니다.
안녕하세요! 좋은 강의 감사드립니다 :D mongodb의 index 관련 수업을 듣고나니까 드는 생각이 mongodb는 NoSQL 인데도 불구하고, RDB 못지않은 굉장히 뛰어난 indexing 기능 (ex. secondary, compound 등)을 갖고 있다라는 생각이 드는데요. 현업에서 만약 여러 NoSQL DB를 고려한다고 가정했을때, mongodb는 다른 NoSQL에 비해 뛰어난 indexing 기능을 제공한다는 것이 차별점이 돼서 선택기준이 될 수 있을까요??
아직 root 폴더에서 npm install 하는 단계입니다. 에러를 구글링하다보니 windows-build-tools 를 설치해야한다고해서, 관리자권한으로 powershell 실행해서 잘 설치했는데 해결되지 않아서요..ㅠㅠ 어떻게 해야할지 알려주실 수 있을까요? ++ 에러메시지 아래 추천으로 npm config set python 을 실행해봤지만 해결되지 않았습니다. node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v83-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@14.16.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! find Python gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "python" can be used gyp ERR! find Python - "python" is not in PATH or produced an error gyp ERR! find Python checking if "python2" can be used gyp ERR! find Python - "python2" is not in PATH or produced an error gyp ERR! find Python checking if "python3" can be used gyp ERR! find Python - "python3" is not in PATH or produced an error gyp ERR! find Python checking if the py launcher can be used to find Python 2 gyp ERR! find Python - "py.exe" is not in PATH or produced an error gyp ERR! find Python checking if Python is C:\Python27\python.exe gyp ERR! find Python - "C:\Python27\python.exe" could not be run gyp ERR! find Python checking if Python is C:\Python37\python.exe gyp ERR! find Python - "C:\Python37\python.exe" could not be run gyp ERR! find Python gyp ERR! find Python ********************************************************** gyp ERR! find Python You need to install the latest version of Python. gyp ERR! find Python Node-gyp should be able to find and use Python. If not, gyp ERR! find Python you can try one of the following options: gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe" gyp ERR! find Python (accepted by both node-gyp and npm) gyp ERR! find Python - Set the environment variable PYTHON gyp ERR! find Python - Set the npm configuration variable python: gyp ERR! find Python npm config set python "C:\Path\To\python.exe" gyp ERR! find Python For more information consult the documentation at: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation gyp ERR! find Python ********************************************************** gyp ERR! find Python gyp ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47) gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16) gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16) gyp ERR! stack at exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! stack at onErrorNT (internal/child_process.js:465:16) gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\김하영\\STUDY\\react\\react_study_2\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\김하영\\STUDY\\react\\react_study_2\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" gyp ERR! cwd C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt gyp ERR! node -v v14.16.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) node-pre-gyp ERR! System Windows_NT 10.0.19042 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\김하영\\STUDY\\react\\react_study_2\\boilerplate-mern-stack-master\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt node-pre-gyp ERR! node -v v14.16.0 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\김하영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\김하 영\STUDY\react\react_study_2\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1) npm WARN react-redux@5.1.2 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself. npm WARN react-redux@5.1.2 requires a peer of redux@^2.0.0 || ^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself. npm WARN react-boiler-plate@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@3.0.8 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@3.0.8 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\jerem\AppData\Roaming\npm-cache\_logs\2021-04-26T00_37_15_758Z-debug.log
안녕하세요. 좋은 강의 감사드립니다 :) 몽고디비 index 관련해서 궁금한 사항이 생겨 질문드립니다. mysql 같은경우에 index를 통한 조회는 disk로 부터 하나의 data block을 fetching하는 single block I/O가 발생하기 때문에 전체 데이터에서 조회하고자 하는 데이터가 많을 경우에는 index를 통한 조회가 full scan보다 오히려 성능적으로 악화되는 구간이 존재하므로 무조건 index를 거는것이 성능에 이점을 주지 않을수도 있다고 알고있는데요. 몽고디비의 index도 동일하다고 생각하면 되는 걸까요?
안녕하세요! 좋은 강의 감사드립니다 :) 강의를 들으면서 mongodb의 data 저장에 대해 한가지 의문사항이 생겨 글 남깁니다! mongodb 같은 경우에는 { _id: ... content: ... user: ... } 와 같은 형태로 data를 저장하는데요. 이럴 경우 해당 collection의 모든 document에서 _id, content, user 값이 즉, key에 해당하는 값이 중복되어 저장되는 구조인가요? (예를 들어, 위와 같은 형식의 document가 10000개 저장된다면 _id, content, user 값 또한 10000번 중복되어 저장) 만약 그렇다면, mongodb는 저장하는 data 형태의 특성상 저장 공간을 효율적으로 사용하지 못한다는 단점을 가지고 있다고 생각해도 되는 걸까요?