Skip to content

Commit

Permalink
fix: aggregation parameter index
Browse files Browse the repository at this point in the history
Signed-off-by: PhilippFruh <[email protected]>
  • Loading branch information
PhilippFr committed Sep 21, 2022
1 parent e83e813 commit 8eafcc3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ class Duration {
*/
@Aggregation(
pipeline = {
"{'$match': {'$and': [{'metaData.currentBookingId': {'$ne': null}}, {'user._id': {'$eq': ?1}}]}}",
"{'$match': {'$and': [{'metaData.currentBookingId': {'$ne': null}}, {'user._id': {'$eq': ?0}}]}}",
"{'$group': {'_id': '$metaData.currentBookingId', 'events': {'$push': {'timestamp': '$timestamp', 'event': '$eventType', 'type': '$metaData.type', 'startTime': '$metaData.startTime', 'endTime': '$metaData.endTime'}}}}",
"{'$match': {'events.event': {'$ne': 'BOOKING_CANCELED'}}}",
"{'$unwind': '$events'}",
"{'$sort': {'events.timestamp': 1}}",
"{'$group': {'_id': '$_id', 'events': {'$push': '$events'}}}",
"{'$match': {'$and': [{'events.0.startTime': {'$gte': ?2}}, {'events.0.startTime': {'$lte': ?3}}]}}",
"{'$match': {'$and': [{'events.0.startTime': {'$gte': ?1}}, {'events.0.startTime': {'$lte': ?2}}]}}",
"{'$count': 'totalCount'}"
})
Count calculateNumbersOfDoneAppointments(String userId, Instant dateFrom, Instant dateTo);
Expand Down

0 comments on commit 8eafcc3

Please sign in to comment.