🗃️ 내가 다시 볼 것

function sameFrequency(str) { let strObj = {}; for (let i of str) { strObj[i] = (strObj[i] || 0) + 1; } return strObj;} 은근히 문자열 요소의 빈도수를 활용하는 문제가 많이 나와서 따로 정리!
await User.findOnd({id}).exec()위와 같은 코드를 보았다. .exec()이 없어도 결과는 똑같았는데 왜 exec()을 사용하는지 궁금해 공식문서를 찾아보았다.   몽구스 오퍼레이터인 .save()와 queries는 thenables한 값을 리턴해준다고 나와있다..then() 을 사용할 수 있다는 뜻인데, 마치 프로미스처럼 보인다.  .save()는 promise를 리턴한다. 그러나 query는 프로미스를 리턴하지 않는다. 갑자기 query는 뭐지? 라는 생각이 들 수 있다.Model.findById() 위 메서드는 몽구스를 사용한다면 정말 많이 쓰게 되는 메서드이다. Return이 Query 임을 볼 수 있다.  공식 문서를 보면 query는 프로미스가 아니지만, async/awa..
router.put("/goods/:goodsId/cart", async (req, res) => { const { params: { goodsId }, body: { quantity }, } = req; const existsCart = await Cart.find({ goodsId: Number(goodsId) }); if (existsCart.length) { await Cart.updateOne({ goodsId: Number(goodsId) }, { $set: { quantity } }); } res.json({ success: true });});put 메서드로 mongo db 데이터를 업데이트 하는 코드를 공부하는데 $set 이라는 기호를 보았다. Mongo DB ..
// click btn id가 like인 경우document.addEventListener("click", (event) => { if (event.target && event.target.id === "like") { }});
본 글은  논문의 전체를 요약하지 않았으며, 개인 공부에 필요한 내용을 취사 선택하여 정리한 내용입니다.  Autonomous Vehicle Security: A Taxonomy of Attacks and DefencesIn recent years, we have seen significant advancement in technologies to bring about smarter cities worldwide. The interconnectivity of things is the key enabler in these initiatives. An important building block is smart mobility, and it revolves around reieeexplore.ieee.org..
전호영
'🗃️ 내가 다시 볼 것' 카테고리의 글 목록 (3 Page)