Skip to content

Commit

Permalink
feat: changed mongodb query used for offset based sse
Browse files Browse the repository at this point in the history
  • Loading branch information
mherwig committed Nov 26, 2024
1 parent d1222c3 commit 2e5bf27
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public interface MessageStateMongoRepo extends MongoRepository<MessageStateMongo
@Query(value = "{status: {$in: ?0}, deliveryType: ?1, subscriptionId: ?2}", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByStatusInAndDeliveryTypeAndSubscriptionIdAsc(List<Status> status, DeliveryType deliveryType, String subscriptionId, Pageable pageable);

@Query(value = "{'_id': {$gt: ?0}, deliveryType: ?1}", sort = "{timestamp: 1}")
List<MessageStateMongoDocument> findByDeliveryTypeAndAfterObjectIdAsc(ObjectId objectId, DeliveryType deliveryType);
@Query(value = "{'_id': {$gt: ?0}, deliveryType: ?1}", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByDeliveryTypeAndAfterObjectIdAsc(ObjectId objectId, DeliveryType deliveryType, Pageable pageable);
@Query(value = "{deliveryType: ?0, subscriptionId: {$in: ?1}, timestamp: { $gt: ?0 }}", sort = "{timestamp: 1}")
List<MessageStateMongoDocument> findByDeliveryTypeAndSubscriptionAndTimestampGreaterThanAsc(DeliveryType deliveryType, String subscriptionId, Date timestamp);
@Query(value = "{deliveryType: ?0, subscriptionId: {$in: ?1}, timestamp: { $gt: ?0 }}", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByDeliveryTypeAndSubscriptionAndTimestampGreaterThanAsc(DeliveryType deliveryType, String subscriptionId, Date timestamp, Pageable pageable);

@Query(value = "{status: {$in: ?0}, deliveryType: ?1, subscriptionId: {$in: ?2}}", sort = "{timestamp: 1}")
List<MessageStateMongoDocument> findByStatusInAndDeliveryTypeAndSubscriptionIdsAsc(List<Status> status, DeliveryType deliveryType, List<String> subscriptionIds);
Expand Down

0 comments on commit 2e5bf27

Please sign in to comment.