Compare commits

...

2 Commits

Author SHA1 Message Date
9a7978235b
Merge remote-tracking branch 'refs/remotes/origin/main' 2024-11-09 18:12:15 +05:30
b36213a58d
Fixed query 2 2024-11-09 17:25:42 +05:30

View File

@ -27,17 +27,20 @@ db.Employee.aggregate([
2. Find Employee with Total Salary for Each City with Designation "Developer":
```mongodb
db.Employee.aggregate([
{
$match: { Designation: "Developer" }
},
{
$group: {
_id: { $arrayElemAt: ["$Address.PAddr", 0] },
TotalSalary: { $sum: "$Salary" }
}
{
$match: {
Designation: "Developer"
}
},
{
$group: {
_id: "$Address.PAddr",
Total: { $sum: "$Salary" }
}
}
])
```
3. Find Total Salary of Employee with Designation "Tester" for Each Company: