Programming
2023. 1. 28.
[MongoDB} aggregate 간단 사용 예시
1. aggregate 사용 예시 db.collection.aggregate(pipeline, options) db.collection.explain().ageaggregate(pipeline, options) 몽고 DB의 aggregate는 위와 같은 양식으로 사용가능하며, explain을 통해 실행 계획을 확인할 수 있다. { "_id" : ObjectId("aaa"), "corp_code" : "1111", "shares" : 100, "price" : 100 } { "_id" : ObjectId("bbb"), "corp_code" : "1111", "shares" : 200, "price" : 200 } { "_id" : ObjectId("ccc"), "corp_code" : "2222", "sh..