Data-Analytics-The-Aggregation-Framework

This project is for the analysis of data through the Aggregation Techniques available in MongoDB and API is made in Python

View the Project on GitHub HrithikMittal/Data-Analytics-The-Aggregation-Framework

Mongo DB

How to run?

For insall jupyter notebook

pip install jupyter notebook


To run type in your terminal

jupyter notebook

Analytics in MongoDB

CRUD                                  Analytics
CREATE ---------> Database  ---------> Group
READ   ---------> (MongoDB) ---------> COUNT
UPDATE --------->           ---------> DERIVE VALUES
DELETE --------->           ---------> FILTER, AVERAGE, SORT

Core Concept : Pipeline

ls -1 ---------> Pipe ---------> wc -l --------->   Terminal
       stdout           stdin            stdout
Ex : ps -ef grep mongod

What is the Aggregation Pipeline?

A series of Document Transformations

Rich Library of functions

Syntax For an Aggregation

aggreate() method
>db.COLLECTION_NAME.aggregate(AGGREGATE_OPERATION)
>db.foo.aggregate([{ stage1 },{ stage2 },{ stage3 }, .... ])
  1. db - variable pointing to current database
  2. collection name
  3. agggregate - method on collection
  4. array of objects, each a pipeline operator
  5. pipeling operators

Some Popular Pipeline Operators

    $match       ---> Filter documents
    $project     ---> Reshape documents
    $group       ---> Summarize documents
    $unwind      ---> Expand arrays in documents
    $sort        ---> Order documents
    $limit/$skip ---> Paginate documents
    $redact      ---> Restrict documents
    $geoNear     ---> Proximity sort documents
    $let         ---> Define variables
    $map         ---> Define variables