Package com.datastax.astra.client.model
Class Filters
java.lang.Object
com.datastax.astra.client.model.Filters
Helper to create Filter
-
Method Summary
Modifier and TypeMethodDescriptionstatic Filter
Build a filter with the `$all` operator.static Filter
Creates a filter that performs a logical AND of the provided list of filters.static Filter
Creates a filter that performs a logical AND of the provided list of filters.static Filter
Creates a filter that matches all documents where the value of _id field equals the specified value.static Filter
Help Building the filters.static Filter
Build a filter with the `$exists` operator.static Filter
Creates a filter that matches all documents where the value of the given field is greater than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.static Filter
Build a filter with the `$hasSize` operator.static <V> Filter
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.static Filter
Creates a filter that matches all documents where the value of the given field is less than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.static Filter
Creates a filter that matches all documents where the value of the field name does not equal the specified value.static <V> Filter
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.static Filter
Creates a filter that performs a logical NOT of the provided filterstatic Filter
Creates a filter that performs a logical OR of the provided list of filters.static Filter
Creates a filter that performs a logical OR of the provided list of filters.
-
Method Details
-
eq
Creates a filter that matches all documents where the value of _id field equals the specified value. Note that this doesn't actually generate a $eq operator, as the query language doesn't require it.- Parameters:
value
- the value, which may be null- Returns:
- the filter
-
eq
Help Building the filters.- Parameters:
fieldName
- current fieldNamevalue
- current fieldValue- Returns:
- filter
-
ne
Creates a filter that matches all documents where the value of the field name does not equal the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gt
Creates a filter that matches all documents where the value of the given field is greater than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gt
Creates a filter that matches all documents where the value of the given field is greater than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gt
Creates a filter that matches all documents where the value of the given field is greater than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gt
Creates a filter that matches all documents where the value of the given field is greater than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gte
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gte
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gte
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
gte
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lt
Creates a filter that matches all documents where the value of the given field is less than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lt
Creates a filter that matches all documents where the value of the given field is less than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lt
Creates a filter that matches all documents where the value of the given field is less than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lt
Creates a filter that matches all documents where the value of the given field is less than the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lte
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lte
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lte
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
lte
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.- Parameters:
fieldName
- the field namevalue
- the value, which may be null- Returns:
- the filter
-
hasSize
Build a filter with the `$hasSize` operator.- Parameters:
fieldName
- target fieldsize
- value for size (positive integer)- Returns:
- filter built
-
exists
Build a filter with the `$exists` operator.- Parameters:
fieldName
- target field- Returns:
- filter built
-
all
Build a filter with the `$all` operator.- Parameters:
fieldName
- target fieldvalues
- list of values for the condition- Returns:
- filter built
-
in
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.- Type Parameters:
V
- the type of the values- Parameters:
fieldName
- the field namevalues
- the list of values- Returns:
- the filter
-
nin
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.- Type Parameters:
V
- the type of the values- Parameters:
fieldName
- the field namevalues
- the list of values- Returns:
- the filter
-
and
Creates a filter that performs a logical AND of the provided list of filters.
will generate a MongoDB query like:and(eq("x", 1), lt("y", 3))
{ $and: [{x : 1}, {y : {$lt : 3}}]}
- Parameters:
filters
- the list of filters to and together- Returns:
- the filter
-
and
Creates a filter that performs a logical AND of the provided list of filters.
will generate a MongoDB query like:and(eq("x", 1), lt("y", 3))
{ $and: [{x : 1}, {y : {$lt : 3}}]}
- Parameters:
filters
- the list of filters to and together- Returns:
- the filter
-
or
Creates a filter that performs a logical OR of the provided list of filters.
will generate a query like:or(eq("x", 1), lt("y", 3))
{ $or: [{x : 1}, {y : {$lt : 3}}]}
- Parameters:
filters
- the list of filters to and together- Returns:
- the filter
-
or
Creates a filter that performs a logical OR of the provided list of filters.
will generate a query like:or(eq("x", 1), lt("y", 3))
{ $or: [{x : 1}, {y : {$lt : 3}}]}
- Parameters:
filters
- the list of filters to and together- Returns:
- the filter
-
not
Creates a filter that performs a logical NOT of the provided filter
will generate a query like:not(eq("x", 1))
{ $and: [{x : 1}, {y : {$lt : 3}}]}
- Parameters:
filter
- the list of filters to and together- Returns:
- the filter
-