Fixed query 2
This commit is contained in:
parent
ddb2505d9f
commit
b36213a58d
@ -28,16 +28,19 @@ db.Employee.aggregate([
|
|||||||
```mongodb
|
```mongodb
|
||||||
db.Employee.aggregate([
|
db.Employee.aggregate([
|
||||||
{
|
{
|
||||||
$match: { Designation: "Developer" }
|
$match: {
|
||||||
|
Designation: "Developer"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$group: {
|
$group: {
|
||||||
_id: { $arrayElemAt: ["$Address.PAddr", 0] },
|
_id: "$Address.PAddr",
|
||||||
TotalSalary: { $sum: "$Salary" }
|
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