목록함수 (2)
taenyLog
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
자바스크립트에서 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 ..