목록몽구스 (5)
taenyLog
async와 await는 JavaScript에서 비동기 작업을 처리하기 위한 키워드입니다. 비동기 작업은 일반적으로 네트워크 요청, 파일 읽기/쓰기, 데이터베이스 쿼리 등 시간이 오래 걸리는 작업을 말합니다. 이러한 작업은 동기적으로 처리하면 프로그램의 실행이 블로킹되어 다른 작업을 수행할 수 없게 됩니다. 이를 해결하기 위해 비동기 작업을 사용합니다. async 키워드는 비동기 함수를 정의할 때 사용됩니다. 이 함수는 항상 Promise를 반환하게 됩니다. await 키워드는 비동기 함수 내부에서 다른 비동기 작업이 완료될 때까지 기다리는 역할을 합니다. await 키워드는 Promise 앞에 사용되며, 해당 Promise가 처리될 때까지 함수의 실행을 일시 중단합니다. 이를 통해 코드가 동기적으로 작..
findByIdAndDelete() 함수는 일치하는 문서를 찾아 제거하고 찾은 문서를 콜백에 전달 https://mongoosejs.com/docs/api/model.html Mongoose v7.3.1: Model Parameters: doc «Object» values for initial set [fields] «Object» optional object containing the fields that were selected in the query which returned this document. You do not need to set this parameter to ensure Mongoose handles your query projection mongoosejs.com
findByIdAndUpdate() 함수는 일치하는 문사를 찾고 , 업데이트 인수에 따라 업데이트하고,옵션을 전달하고 , 찾은 문서를 콜백에 반환하는데 사용 Issues a mongodb findOneAndUpdate command by a document's _id field. findByIdAndUpdate(id, ...) is equivalent to findOneAndUpdate({ _id: id }, ...). Finds a matching document, updates it according to the update arg, passing any options, and returns the found document (if any). This function triggers the follo..

https://www.mongodb.com/docs/manual/reference/method/db.collection.insertMany/ db.collection.insertMany() — MongoDB Manual Docs Home → MongoDB Manual db.collection.insertMany()mongosh MethodThis page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.For the database command, see the insert command.Fo www.mongodb.com 모델의 ..