Skip to content

Commit

Permalink
Refactor GetTop3MostBookedRooms to include roomId in the group by clause
Browse files Browse the repository at this point in the history
  • Loading branch information
waveyboym committed Sep 27, 2024
1 parent b42457f commit c47daf5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions occupi-backend/pkg/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ func GetTop3MostBookedRooms(creatorEmail string, attendeeEmails []string, filter
// Stage 4: Group by the room ID to calculate the total bookings
bson.D{{Key: "$group", Value: bson.D{
{Key: "_id", Value: "$roomId"},
{Key: "roomId", Value: "$roomId"},
{Key: "roomName", Value: bson.D{{Key: "$first", Value: "$roomName"}}},
{Key: "floorNo", Value: bson.D{{Key: "$first", Value: "$floorNo"}}},
{Key: "creators", Value: bson.D{{Key: "$push", Value: "$creator"}}},
Expand Down

0 comments on commit c47daf5

Please sign in to comment.