Compare commits
2 Commits
371bf261b9
...
9a7978235b
Author | SHA1 | Date | |
---|---|---|---|
9a7978235b | |||
b36213a58d |
@ -28,16 +28,19 @@ db.Employee.aggregate([
|
||||
```mongodb
|
||||
db.Employee.aggregate([
|
||||
{
|
||||
$match: { Designation: "Developer" }
|
||||
$match: {
|
||||
Designation: "Developer"
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: { $arrayElemAt: ["$Address.PAddr", 0] },
|
||||
TotalSalary: { $sum: "$Salary" }
|
||||
_id: "$Address.PAddr",
|
||||
Total: { $sum: "$Salary" }
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
```
|
||||
|
||||
3. Find Total Salary of Employee with Designation "Tester" for Each Company:
|
||||
|
Loading…
Reference in New Issue
Block a user