MUG Chandigarh: From Agents to Applications: Exploring AI with MongoDB

MUG Chandigarh: From Agents to Applications: Exploring AI with MongoDB

Join us at MongoDB.local Chandigarh for an exciting and insightful event focused on Building AI Agents and Developing Powerful Generative AI Applications with MongoDB and Google Cloud.

This event will cover everything you need to know—from foundational concepts to hands-on implementation techniques—on how to leverage the power of MongoDB’s flexible, scalable database with Google Cloud’s advanced AI tools.

What To Expect

  • A to Z of Building AI Agents: Learn how to design, train, and deploy intelligent agents that can automate tasks, make decisions, and improve processes with AI.
  • Generative AI Applications: Discover how to build cutting-edge applications powered by Generative AI, enabling creativity, automation, and smarter decision-making.
  • Integration with MongoDB: Explore how MongoDB’s fully-managed database platform can seamlessly support AI-driven applications, ensuring scalability, flexibility, and high performance.

Where?

Event Type: In-Person
Location: SoftoBiz Technologies (P) LTD, Sector 67, Sahibzada Ajit Singh Nagar, Punjab 160062

Agenda

Time Topic
10:00 AM Registration
10:30 AM Exploring MongoDB Certification Paths
11:00 AM The A to Z of Building AI Agents
01:00 PM Building Powerful Gen AI Applications With MongoDB and Google Cloud
02:00 PM Lunch and Networking

:key: Why Attend?

:white_check_mark: Get complete path for MongoDB Certifications
:white_check_mark: Learn from Experts: Hear from professionals sharing practical tips and best practices.
:white_check_mark: Unlock the Power of MongoDB for AI and Generative AI Applications!
:white_check_mark: Network with other MongoDB enthusiasts and expand your professional connections.
:white_check_mark: Stay Ahead of the Curve: Discover the latest advancements and best practices in MongoDB.
:white_check_mark: Get Hands-On: Participate in interactive exercises and labs to apply

:tickets: Registration and Details

Secure your spot at From Agents to Applications: Exploring AI with MongoDB! Limited seats are available.

:star2: Don’t miss out on this incredible opportunity to explore the limitless possibilities of MongoDB. Join us at to unlock new horizons for your tech career! See you there! :wave::rocket:

:e-mail: For any inquiries, please contact our team

#UnleashingMongoDB #TechEvents #MongoDB #MUGChandigarh

3 Likes

Might miss the session this time due to dates ;(

1 Like

wowwww i am in for sure

1 Like

Squid Games-themed MongoDB Challenge: “The Survival Query”

In this Squid Game-inspired challenge, participants will play the role of contestants in a fictional “Data Survival Game.” Each query they solve keeps them alive in the game, while incorrect or delayed responses risk “elimination”.

About the Dataset

The dataset revolves around players, games, eliminations and prize pool.

Collections and their Schema

1. players Collection

Field Type Description
player_id String A unique identifier for each player (e.g., “P001”).
name String The player’s full name (e.g., “John Doe”).
age Integer The player’s age in years (e.g., 29).
debt Integer The amount of debt the player has (e.g., 500000).
status String The player’s current status: "active" or "eliminated".

2. games Collection

Field Type Description
game_id String A unique identifier for each game (e.g., “G001”).
name String The name of the game (e.g., “Red Light Green Light”).
difficulty Integer A difficulty level on a scale of 1 to 10 (e.g., 8).
max_players Integer The maximum number of players allowed in the game (e.g., 200).

3. eliminations Collection

Field Type Description
elimination_id String A unique identifier for each elimination event (e.g., “E001”).
player_id String The unique identifier of the eliminated player (e.g., “P010”).
game_id String The unique identifier of the game where elimination occurred.
reason String The reason for the player’s elimination (e.g., “Crossed the line”).

4. prize_pool Collection

Field Type Description
current_pool Integer The total prize pool value after the game (e.g., 456000000).
game_id String The unique identifier of the game linked to this prize pool (e.g., “G003”).
eliminated_players Integer The total number of players eliminated in the corresponding game (e.g., 45).

Challenge Format

Each query is tied to a game or event in the Squid Game storyline.

The goal is to ensure contestants progress through the rounds by correctly answering queries.

Queries

Beginner Level

  1. Find Active Players: Retrieve all players who are still active in the game.
  2. Count Number of Players: Count the total number of players.
  3. Find Eliminations in Game No. 3: Find all eliminations in G003.

Intermediate Level

  1. Players in Specific Age Range: Find players who are between 25 and 35 years old.
  2. Find Games With Difficulty Above 7: Find games with difficulty greater than 7.
  3. Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.

Expert Level

  1. Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.
  2. Players with Odd Age: Find players whose age is odd.

Advanced Level

  1. Game with Maximum Contribution towards Prize Pool: Find the game that contributed the most to the prize pool.
  2. Player with Maximum Debt in each Age Group: Find the player with the maximum debt in each age group.

1 Like

1.Find Active Players: Retrieve all players who are still active in the game.
output —db.players.find({ status: “active” });

3.Find Eliminations in Game No. 3: Find all eliminations in G003.
db.eliminations.find({ game_id: “G003” });

2.Count Number of Players: Count the total number of players.
db.players.countDocuments({});

4.Players in Specific Age Range: Find players who are between 25 and 35 years old.
db.players.find({ age: { $gte: 25, $lte: 35 } });

5.Find Games With Difficulty Above 7: Find games with difficulty greater than 7.
db.games.find({ difficulty: { $gt: 7 } });

6.Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.
db.eliminations.aggregate([
{ $group: { _id: “$reason”, count: { $sum: 1 } } },
{ $sort: { count: -1 } }
]);

7.Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.
db.players.find().sort({ debt: -1 }).limit(5);

8.Players with odd age
db.players.find({ age: { $mod: [2, 1] } });

9.Game with Maximum Contribution towards Prize Pool
db.prize_pool.aggregate([
{ $group: { _id: “$game_id”, total_pool: { $sum: “$current_pool” } } },
{ $sort: { total_pool: -1 } },
{ $limit: 1 }
]);

10.Player with Maximum Debt in each Age Group
db.players.aggregate([
{ $group: { _id: “$age”, maxDebtPlayer: { $first: “$$ROOT” }, maxDebt: { $max: “$debt” } } },
{ $sort: { _id: 1 } }
]);

Beginner Level

  1. Find Active Players: Retrieve all players who are still active in the game.
    db.players.find({ status: “active” })
  2. Count Number of Players: Count the total number of players.
    db.players.countDocuments({})
  3. Find Eliminations in Game No. 3: Find all eliminations in G003.
    db.eliminations.find({ game_id: “G003” })

Intermediate Level
4. Players in Specific Age Range: Find players who are between 25 and 35 years old.
db.players.find({ age: { $gte: 25, $lte: 35 } })
5. Find Games With Difficulty Above 7: Find games with difficulty greater than 7.
db.games.find({ difficulty: { $gt: 7 } })
6. Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.
db.eliminations.aggregate([
{ $group: { _id: “$reason”, count: { $sum: 1 } } },
{ $sort: { count: -1 } }
])

Expert Level
7. Top 5 Players with the Highest Debt: Find the top 5 players based on the amount of debt they owe.
db.players.find().sort({ debt: -1 }).limit(5)
8. Players with Odd Age: Find players whose age is odd.
db.players.find({ age: { $mod: [2, 1] } })

Advanced Level
9. Game with Maximum Contribution towards Prize Pool: Find the game that contributed the most to the prize pool.
db.prize_pool.aggregate([
{ $sort: { current_pool: -1 } },
{ $limit: 1 }
])
10. Player with Maximum Debt in Each Age Group: Find the player with the maximum debt in each age group.
db.players.aggregate([
{ $bucket: {
groupBy: “$age”,
boundaries: [0, 20, 30, 40, 50, 60],
default: “Other”,
output: { maxDebt: { $max: “$debt” } }
}},
{ $sort: { maxDebt: -1 } }
])

MongoDB Queries for Game Data Analysis

Hi!

I have solved all the questions !

  1. Find Active Players: Retrieve all players who are still active in the game.
    ==> db.players.find()

  2. Count Number of Players: Count the total number of players.
    ==> db.players.countDocuments()

  3. Find Eliminations in Game No. 3: Find all eliminations in G003.
    ==> db.games.find({ game_number: ‘G003’ }, { eliminations: 1 })

  4. Players in Specific Age Range: Find players who are between 25 and 35 years old.
    ==> db.players.find({ age: { $gte: 25, $lte: 35 } })

  5. Find Games With Difficulty Above 7: Find games with difficulty greater than 7.
    ==> db.games.find({ difficulty: { $gt: 7 } })

  6. Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.
    ==> db.eliminations.aggregate([
    { $group: { _id: “$reason”, count: { $sum: 1 } } },
    { $sort: { count: -1 } }
    ])

  7. Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.
    ==> db.players.find().sort({ debt: -1 }).limit(5)

  8. Players with Odd Age: Find players whose age is odd.
    ==> db.players.find({ age: { $mod: [2, 1] } })

  9. Game with Maximum Contribution towards Prize Pool: Find the game that contributed the most to the prize pool.
    ==> db.games.aggregate([
    { $lookup: {
    from: “prizepool”,
    localField: “game_id”,
    foreignField: “game_id”,
    as: “prize”
    }},
    { $unwind: “$prize” },
    { $group: { _id: “$game_id”, totalContribution: { $sum: “$prize.amount” } } },
    { $sort: { totalContribution: -1 } },
    { $limit: 1 }
    ])

  10. Player with Maximum Debt in each Age Group: Find the player with the maximum debt in each age group.
    ==> db.players.aggregate([
    { $group: { _id: { $floor: { $divide: [“$age”, 10] } }, maxDebt: { $max: “$debt” } } },
    { $lookup: {
    from: “players”,
    localField: “maxDebt”,
    foreignField: “debt”,
    as: “player”
    }},
    { $unwind: “$player” }
    ])

All are Done!

1.Find Active Players: Retrieve all players who are still active in the game.
db.players.find({status:“active”})

2.Count Number of Players: Count the total number of players.
db.players.count()

3.Find Eliminations in Game No. 3: Find all eliminations in G003.
db.eliminations.find({game_id:“G003”})

4.Players in Specific Age Range: Find players who are between 25 and 35 years old.
db.players.find({age:{$gte:25,$lte:35}});

5.Find Games With Difficulty Above 7
db.games.find({difficulty:{$gte:7}});

6.Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.
db.eliminations.aggregate([
{
$group: {
_id: “$reason”,
count: { $sum: 1 }
}
},
{
$sort: { count: -1 }
}
])

7.Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.
db.players.aggregate([
{
$sort: { debt: -1 } // Sort players by ‘debt’ in descending order
},
{
$limit: 5 // Limit the result to the top 5 players
}
])

  1. Players with Odd Age: Find players whose age is odd.
    db.players.find({
    age: { $mod: [2, 1] } // Finds players where age % 2 equals 1 (odd numbers)
    })
  1. db.players.find({ active: true });
  2. db.players.countDocuments({});
  3. db.eliminations.find({ game_id: “G003” });
  4. db.players.find({ age: { $gte: 25, $lte: 35 } });
  5. db.games.find({ difficulty: { $gt: 7 } });
  6. db.eliminations.aggregate([
    { $group: { _id: “$reason”, count: { $sum: 1 } } },
    { $sort: { count: -1 } },
    { $limit: 1 }
    ]);
  7. db.players.find({}).sort({ debt: -1 }).limit(5);
  8. db.players.find({ age: { $mod: [2, 1] } });

Here are ques and their solutions
// ques 1 and 2

  1. Find Active Players: Retrieve all players who are still active in the game.
  2. Count Number of Players: Count the total number of players.
    db.getCollection(‘players’).aggregate(
    [
    { $match: { status: ‘active’ } },
    { $count: ‘string’ }
    ],
    );

// ques 3
3. Find Eliminations in Game No. 3: Find all eliminations in G003.
db.getCollection(‘eliminations’).aggregate(
[{ $match: { game_id: ‘G003’ } }],
);

// ques4
4. Players in Specific Age Range: Find players who are between 25 and 35 years old.
db.getCollection(‘players’).aggregate(
[
{
$match: {
$and: [
{ age: { $gte: 25 } },
{ age: { $lte: 35 } }
]
}
}
],
);

// ques5
5. Find Games With Difficulty Above 7: Find games with difficulty greater than 7.
{
difficulty: { $gt: 7 }
}

// ques6
6. Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.
db.getCollection(‘eliminations’).aggregate(
[
{
$group: {
_id: ‘$reason’,
count: { $sum: 1 }
}
},
{ $sort: { count: -1 } }
],
);

// ques 7
7. Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.
db.getCollection(‘players’).aggregate(
[{ $sort: { debt: -1 } }, { $limit: 5 }],
);

// ques8
8. Players with Odd Age: Find players whose age is odd.
db.getCollection(‘players’).aggregate(
[{ $match: { age: { $mod: [2, 1] } } }],
);

2 Likes
  1. db.players.find({ active: true });
  2. db.players.countDocuments({});
  3. db.eliminations.find({ game_id: “G003” });
  4. db.players.find({ age: { $gte: 25, $lte: 35 } });
  5. db.games.find({ difficulty: { $gt: 7 } });
  6. db.eliminations.aggregate([
    { $group: { _id: “$reason”, count: { $sum: 1 } } },
    { $sort: { count: -1 } },
    { $limit: 1 }
    ]);
  7. db.players.find({}).sort({ debt: -1 }).limit(5);
  8. db.players.find({ age: { $mod: [2, 1] } });
1 Like

Solved mongo db questions queries…

Q 1) Squid-Games.players.find({ active: true });

Q 2) Squid-Games.players.countDocuments();

Q 3) Squid-Games.games.find({ game_id: “G003” });

Q 4) Squid-Games.players.find({ age: { $gte: 25, $lte: 35 } });

Q 5) Squid-Games.games.find({ difficulty: { $gt: 7 } });

Q 6) Squid-Games.players.aggregate([
{ $group: { _id: “$reason”, count: { $sum: 1 } } },
{ $sort: { count: -1 } }
]);

Q 7) Squid-Games.players.aggregate([
{ $sort: { debt: -1 } },
{ $limit: 5 }
]);

2 Likes

i have solved top 5 question and query for that is
1.{ “status”: “active” }
2.{}
3.{ “game_id”: “G003” }
4.{ “age”: { “$gte”: 25, “$lte”: 33 } }
5.{ “difficulty”: { “$gt”: 7 } }

2 Likes

Q1. Find Active Players: Retrieve all players who are still active in the game.

db[“players”].find({status: “active”})

Q2. Count Number of Players: Count the total number of players.

db.players.count()

Q3. Find Eliminations in Game No. 3: Find all eliminations in G003.

db.eliminations.find({game_id: “G003”})

Q4. Players in Specific Age Range: Find players who are between 25 and 35 years old.

db.players.find({age: {$gte: 25, $lte: 35}})

Q5. Find Games With Difficulty Above 7: Find games with difficulty greater than 7.

db.games.find({difficulty: {$gte: 7}})

Q6. Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.

db.eliminations.aggregate([
{ $group: { _id: “$reason”, count: { $sum: 1 } } },
{ $sort: { count: -1 } }
])

Q7. Top 5 Players with the Highest Debt: Find the top 5 players based on the amount of debt they owe.

db.players.aggregate([
{ $sort: { debt: -1 } },
{ $limit: 5 },
{ $project: { _id: 0, player_id: 1, name: 1, debt: 1 } }
])

Q8. Players with Odd Age: Find players whose age is odd.

db.players.find({ age: { $mod: [2, 1] } })

Q9. Game with Maximum Contribution towards Prize Pool: Find the game that contributed the most to the prize pool.

db.games.find().sort({current_pool: -1}).limit(1)

Q10. Player with Maximum Debt in each Age Group: Find the player with the maximum debt in each age group.

db.players.aggregate([
{
$group: {
_id: “$age”,
maxDebtPlayer: { $first: “$$ROOT” },
maxDebt: { $max: “$debt” }
}
},
{ $sort: { _id: 1 } }
])

1 Like
  1. db.players.find({status:“active”})
  2. db.players.countDocuments()
  3. db.eliminations.find({game_id:“G003”})
  4. db.players.find({age: { $gte: 25, $lte: 35 }})
  5. db.games.find({difficulty: { $gt: 7 }})
  6. db.eliminations.aggregate([{
    $group: {
    _id: “$reason”,
    count: { $sum: 1 } }
    },
    {$sort: { count: -1 }},
    { $limit : 1}
    ])
  7. db.players.find({}).sort({ debt: -1 }).limit(5)
  8. db.players.find({age: { $mod: [2, 1] }})
  1. db.players.find({ active: true });
  2. db.players.countDocuments({});
  3. db.eliminations.find({ game_id: “G003” });
  4. db.players.find({ age: { $gte: 25, $lte: 35 } });
  5. db.games.find({ difficulty: { $gt: 7 } });
  6. db.eliminations.aggregate([
    { $group: { _id: “$reason”, count: { $sum: 1 } } },
    { $sort: { count: -1 } },
    { $limit: 1 }
    ]);
  7. db.players.find({}).sort({ debt: -1 }).limit(5);
  8. db.players.find({ age: { $mod: [2, 1] } });
1 Like

I recently got the opportunity to attend MongoDB Event organized by MUG Chandigarh and in the event all participants got engaged with this squid games challenge and we enjoyed it so much. Here are some questions which I answered in the event -

1.Find Active Players: Retrieve all players who are still active in the game.
Ans — db.players.find({ status: “active” });

2.Count Number of Players: Count the total number of players.
Ans - db.players.countDocuments({});

3.Find Eliminations in Game No. 3: Find all eliminations in G003.
Ans - db.eliminations.find({ game_id: “G003” });

4.Players in Specific Age Range: Find players who are between 25 and 35 years old.
Ans - db.players.find({ age: { $gte: 25, $lte: 35 } });

5.Find Games With Difficulty Above 7: Find games with difficulty greater than 7.

Ans - db.games.find({ difficulty: { $gt: 7 } });

6.Find Most Common Elimination Reason: Group by reason and count the number of times each reason appears, sorting by frequency.

Ans - db.eliminations.aggregate([
{ $group: { _id: “$reason”, count: { $sum: 1 } } },
{ $sort: { count: -1 } }
]);

7.Top 5 Players with the Highest Debt Find the top 5 players based on the amount of debt they owe.

Ans - db.players.find().sort({ debt: -1 }).limit(5);

8.Players with odd age

Ans - db.players.find({ age: { $mod: [2, 1] } });

9.Game with Maximum Contribution towards Prize Pool

Ans - db.prize_pool.aggregate([
{ $group: { _id: “$game_id”, total_pool: { $sum: “$current_pool” } } },
{ $sort: { total_pool: -1 } },
{ $limit: 1 }
]);

10.Player with Maximum Debt in each Age Group

Ans - db.players.aggregate([
{ $group: { _id: “$age”, maxDebtPlayer: { $first: “$$ROOT” }, maxDebt: { $max: “$debt” } } },
{ $sort: { _id: 1 } }
]);

1 Like