Compare commits
No commits in common. "9a7978235b3bc1f59dfddab8cbd4141754af2665" and "371bf261b9eb8607bcf1f98864c22bba6c59fcad" have entirely different histories.
9a7978235b
...
371bf261b9
@ -27,20 +27,17 @@ db.Employee.aggregate([
|
|||||||
2. Find Employee with Total Salary for Each City with Designation "Developer":
|
2. Find Employee with Total Salary for Each City with Designation "Developer":
|
||||||
```mongodb
|
```mongodb
|
||||||
db.Employee.aggregate([
|
db.Employee.aggregate([
|
||||||
{
|
{
|
||||||
$match: {
|
$match: { Designation: "Developer" }
|
||||||
Designation: "Developer"
|
},
|
||||||
|
{
|
||||||
|
$group: {
|
||||||
|
_id: { $arrayElemAt: ["$Address.PAddr", 0] },
|
||||||
|
TotalSalary: { $sum: "$Salary" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
$group: {
|
|
||||||
_id: "$Address.PAddr",
|
|
||||||
Total: { $sum: "$Salary" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Find Total Salary of Employee with Designation "Tester" for Each Company:
|
3. Find Total Salary of Employee with Designation "Tester" for Each Company:
|
||||||
|
Loading…
Reference in New Issue
Block a user