MongoDB Query 연습문제
기본 데이터 db.inventory.insertMany([ ... { item: "journal",status: "A",size:{h:14, w:21, uom:"cm"},instock:[{warehouse:"A",qty:5}]}, ... { item: "notebook",status: "A",size:{h:8.5, w:11, uom:"in"},instock:[{warehouse:"C",qty:5}]}, ... { item: "paper",status: "D",size:{h:8.5, w:11, uom:"in"},instock:[{warehouse:"A",qty:60}]}, ... { item: "planner",status: "D",size:{h:22.85, w:30, uom:"cm"},instock:[{..
MongoDB query 이해하기
Document에 저장된 객체의 하위객체 찾기 var mydoc = { _id: objectId("5099803df3f4948bd2f98391"), name:{first:"Alan", last:"Turing"}, birth: new Date('Jun 23,1912'), death: new Date('Jun 07, 1954'), contribs: ["Turing machine", "Turing test", "Turingery"], views: numberLong(1250000) } //옳은 문법 //db.user.find({name:{first:"Alan"}}) //틀린 문법 //db.user.find({"name.first":"Alan"}}) 위와 같은 document 값이 존재한다고 할 시, "Alan..