(5 points)
Design the data structures based on the analytical tasks (see HW1) that are intended to be solved with MongoDB.
Insert the data into MongoDB using the CSV/JSON generated for the project (see HW0). Use the Base dataset as defined in HW0.
Implement and run the queries (see HW1). Create supporting indexes for every analytical query.
Use the Aggregation Pipeline; do not use `$where`, server-side JavaScript, or `mapReduce`.
Apply appropriate time filters, groupings, and KPIs as required by your HW1 tasks (do not hardcode specific fields like “country/action” if your domain differs).
For each query, include `db.collection.explain(“executionStats”).aggregate(…)` (or the relevant command) and show a compact excerpt of the plan in the report.
Prepare a report and include:
the text from HW0 and HW1 (edited if necessary);
the collections creation and document-insertion commands, with explanations of why this structure was chosen;
the data import code;
the queries used to solve the analytical tasks. For each task, provide:
the task number (as in the previous work);
the verbal description of the task;
the query code with explanations;
a screenshot (or excerpt) of the query result and the `explain(“executionStats”)` output.
Note. If some analytical tasks turn out to be infeasible or meaningless, you may replace them with others and propagate the corresponding changes to the earlier work (HW0/HW1).
Submit to the BRUTE system:
Submit to the NoSQL server (nosql.felk.cvut.cz) the hw3.js file with MongoDB commands with short comments.
mongosh --port 42222 -u login -p password database hw3.js
$login
is your username, e.g. f25_login
$database
- database to connect to (same as login)
$password
is your password (Use the same password you received for your account at the beginning of the semester)
$file
is a file with MongoDB queries to be executed, i.e. hw3.js
Double dashes before port
Tools:
MongoDB 7.0.14 (installed on the NoSQL server)
References:
Server: nosql.felk.cvut.cz
Deadline: Sunday 23. 11. 2025 until 23:59