본문 바로가기

반응형

MongoDB

MongoDB: 고급 쿼리(Advanced Queries - Aggregation Framework) Aggreagation Pipeline Aggregate() function is used for creating pipelines db.COLLECTION_NAME.aggregate(pipline,options) Documents enter a multi-stage pipline that transforms the documents into an aggregated result → document는 multi-stage pipline을 통과해서 aggregated된 result를 반환 SQL to Attregation Mapping Chart Aggregation Pipeline Stages $match { $match: {query}} aggregation pipeline은 가능하면 앞에 둔다. ag.. 더보기
MongoDB: 중급 쿼리 (Manipulating Data - Intermediate Query) Query embedded document {field : document} 순서가 다를 경우 검색이 안됨 모든 embedded document의 필드가 없으면 검색이 안됨 // 알맞은 쿼리 db.inventory.find({size: {h:14, w:21, uom: "cm"}}) // 틀린 쿼리 // 순서가 다르면 검색이 안된다. db.inventory.find({size: {w:21, h:14, uom:"cm"}}) // 모두 매치되지 않으면, 검색이 안된다. db.inventory.find({size: {h:14, w:21}}) (”field.nestedField”) // size.uom이 "in"인 값들을 찾는다. db.inventory.find({"size.uom": "in"}) // size... 더보기
MongoDB: 기본 쿼리(Basic Quries) 이 글은 전공 "빅데이터시스템" 강의 내용을 정리한 글입니다. Query Document The find() method db.COLLECTION_NAME.find(query, projection) collection내에 모든 document를 select db.inventory.find() db.inventory.find().pretty()SELECT * FROM inventoryQuery operator Comparison operators $eq { field : {$eq: value}} SELECT * FROM inventory WHERE qty = 25 db.inventory.find({qty:{$eq:25}}) db.inventory.find({qty:25}) $gt, $gte, $lt, $l.. 더보기
MongoDB Overview 이 글은 전공 "빅데이터시스템" 강의 내용을 정리한 글입니다. MongoDB 하나의 Collection이 여러 document를 보관할 수 있는 Document Database Relationship of RDBMS terminology with MongoDB RDBMS MongoDB Database Database Table Collection Tuple/Row Document column field Table Join Embedded Documents Primary Key Primary Key(Defalut Ket _id provded by mongodb it self) Mysqld/Oracle mongod mysql/sqlplus mongo RDBMS에서는 3개의 테이블이 필요하지만, MongoDB.. 더보기
Introduction to Big Data 이 글은 전공 "빅데이터시스템" 강의 내용을 정리한 글입니다. 데이터의 유형(Types of data) Structured Data Unstructured Data Can be displayed in rows, columns and relational databases Can not be displayed in rows, columns and relational databases Numbers, dates, and strings Images, audio, video, word processing files, e-mails, spreadsheets Requires less storage Requires more storage Estimated 20% of enterprise data Estimated 80.. 더보기