MongoDB - Query에서 반환할 projectjon field
Database/MongoDB

💡 MongoDB 공식문서를 참고하였다. 참고 : https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/ Project Fields to Return from Query — MongoDB Manual Docs Home → MongoDB Manual➤ Use the Select your language drop-down menu in the upper-right to set the language of the following examples.By default, queries in MongoDB return all fields in matching documents. To limit the amount of data that..

MongoDB - 배열 쿼리 - (1)
Database/MongoDB

💡 MongoDB 공식 문서를 참고해서 작성하였다. 참고 : https://docs.mongodb.com/manual/tutorial/query-arrays/ 배열 쿼리 inventory collection 기반으로 예제를 진행한다. 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", s..

MongoDB - Document Query(조회) - (2)
Database/MongoDB

💡 MongoDB 공식 문서를 참고해서 작성하였다. 참고 : https://docs.mongodb.com/manual/tutorial/query-embedded-documents/ Query on Embedded/Nested Documents — MongoDB Manual Docs Home → MongoDB Manual➤ Use the Select your language drop-down menu in the upper-right to set the language of the following examples.For example, the following query selects all documents where the field size equals the document { h: 14, w: ..

MongoDB - Document Query(조회) - (1)
Database/MongoDB

💡 MongoDB 공식 문서를 참고해서 작성하였다. 참고 : https://docs.mongodb.com/manual/tutorial/query-documents/ Query Documents 주어지는 예시를 통해서 db.collection.find() method를 mongosh에서 실행할 것이다. 일단 insertMany()를 통해 inventory라는 collection에 document들을 추가한다. db.inventory.insertMany([ { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" },..