Class MongoFilterSpecification.MongoBsonFilterSpecification

java.lang.Object
org.occurrent.subscription.mongodb.MongoFilterSpecification
org.occurrent.subscription.mongodb.MongoFilterSpecification.MongoBsonFilterSpecification
All Implemented Interfaces:
SubscriptionFilter
Enclosing class:
MongoFilterSpecification

public static class MongoFilterSpecification.MongoBsonFilterSpecification extends MongoFilterSpecification
Use e.g. Filters to create a bson filter. Note that MongoDB wraps the cloud event in a document called "fullDocument" so you need to take this into account when creating custom filters. Note also that each filter entry must be a valid aggregation stage. For more simple filters use the predefined filter methods such as id(BiFunction, String) and type(BiFunction, String).

Examples:

 filter().type(Filters::eq, "12345").and().data("someInt", Filters::lt, 3))
 

which can be written like this if created manually:

 filter(match(eq("fullDocument.id", "12345")), matches(lt("fullDocument.data.someInt", 3)))))