Skip to content

Conversation

@Alaa2019-ml
Copy link

No description provided.

@crevulus crevulus self-assigned this Dec 13, 2025
Copy link

@crevulus crevulus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, Alaa!

@@ -0,0 +1,102 @@
const { MongoClient, ServerApiVersion } = require("mongodb");
const uri =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful! Don't commit sensitive keys/codes etc to your remote repository. Hackers may be able to access them and steal your data.

Use an env file that you keep locally.

const pipeline = [
{
$match: {
Country: country,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to change this now - just bear this in mind!

Something you may want to consider when you're working with CSV data: Spreadsheets often use Title Case for their headings (Country, Year, etc.). When we're designing databses, we don't usually use this case. We usually use lowercase or snake_case, removing any whitespace and standardising the cases of the letters.

When converting from CSV to database columns you might want to consider your naming conventions. But you do not need to do that for this exercise - jsut something to remember for the future as not following naming conventions will make it harder/less intuitive for other people to work with your databases.

},
{
$group: {
_id: "$Year",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a data import file in your PR. Can you explain how you got your data into your db?

From the README:

Find a way to get the data in the csv file into your MongoDB database.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imported the CSV file directly into MongoDB Atlas using the Atlas import tools. Was I supposed to handle the data import via Node.js instead?

@Alaa2019-ml
Copy link
Author

ex1_aggregation_consoleOutput ex2_transactions_console_output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants