Package org.dizitart.no2.filters
Class FluentFilter
java.lang.Object
org.dizitart.no2.filters.FluentFilter
A fluent api for the
NitriteFilter.- Since:
- 4.0
- Author:
- Anindya Chatterjee.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbetween(Comparable<?> lowerBound, Comparable<?> upperBound) Creates a filter that matches documents where the value of the field is between the specified lower and upper bounds.between(Comparable<?> lowerBound, Comparable<?> upperBound, boolean inclusive) Creates a filter that matches documents where the value of the field is between the given lower and upper bounds.between(Comparable<?> lowerBound, Comparable<?> upperBound, boolean lowerInclusive, boolean upperInclusive) Creates a filter that matches documents where the value of a field is between two specified values.Creates a filter that matches documents where the value of a field contains at least one element that matches the specified filter.Creates an equality filter that matches documents where the value of a field equals the specified value.gt(Comparable<?> value) Creates a filter that matches all documents where the value of the specified field is greater than the given value.gte(Comparable<?> value) Creates a filter that matches documents where the value of the field is greater than or equal to the specified value.in(Comparable<?>... values) Creates a filter that matches documents where the value of the field is in the specified array of values.lt(Comparable<?> value) Creates a filter that matches documents where the value of the field is less than the specified value.lte(Comparable<?> value) Creates a filter that matches documents where the value of the field is less than or equal to the specified value.Creates a filter that matches all documents where the value of the specified field is not equal to the given value.notIn(Comparable<?>... values) Creates a filter that matches documents where the value of the field is not in the specified array of values.Creates a filter that matches documents where the value of the specified field matches the specified regular expression pattern.Creates a filter which performs a text search on the content of the fields indexed with a full-text index.static FluentFilterCreates a newFluentFilterinstance with the specified field name.
-
Field Details
-
$
The where clause for elemMatch filter.
-
-
Method Details
-
where
Creates a newFluentFilterinstance with the specified field name.- Parameters:
field- the name of the field to filter on- Returns:
- a new
FluentFilterinstance with the specified field name
-
eq
Creates an equality filter that matches documents where the value of a field equals the specified value.- Parameters:
value- the value to match against.- Returns:
- a
NitriteFilterinstance representing the equality filter.
-
notEq
Creates a filter that matches all documents where the value of the specified field is not equal to the given value.- Parameters:
value- the value to compare against.- Returns:
- a
NitriteFilterinstance.
-
gt
Creates a filter that matches all documents where the value of the specified field is greater than the given value.- Parameters:
value- the value to compare against.- Returns:
- the NitriteFilter instance representing the greater than filter.
-
gte
Creates a filter that matches documents where the value of the field is greater than or equal to the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is greater than or equal to the specified value.
-
lt
Creates a filter that matches documents where the value of the field is less than the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is less than the specified value.
-
lte
Creates a filter that matches documents where the value of the field is less than or equal to the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is less than or equal to the specified value.
-
between
Creates a filter that matches documents where the value of the field is between the specified lower and upper bounds.- Parameters:
lowerBound- the lower bound (inclusive) of the range to match.upperBound- the upper bound (inclusive) of the range to match.- Returns:
- a filter that matches documents where the value of the field is between the specified lower and upper bounds.
-
between
Creates a filter that matches documents where the value of the field is between the given lower and upper bounds.- Parameters:
lowerBound- the lower bound of the range (inclusive).upperBound- the upper bound of the range (inclusive).inclusive- whether the bounds are inclusive or not.- Returns:
- a filter that matches documents where the value of the field is between the given lower and upper bounds.
-
between
public NitriteFilter between(Comparable<?> lowerBound, Comparable<?> upperBound, boolean lowerInclusive, boolean upperInclusive) Creates a filter that matches documents where the value of a field is between two specified values.- Parameters:
lowerBound- the lower bound (inclusive) of the rangeupperBound- the upper bound (inclusive) of the rangelowerInclusive- true if the lower bound is inclusive, false otherwiseupperInclusive- true if the upper bound is inclusive, false otherwise- Returns:
- a filter that matches documents where the value of a field is between two specified values
-
text
Creates a filter which performs a text search on the content of the fields indexed with a full-text index.- Parameters:
value- the text value- Returns:
- the text filter
- See Also:
-
regex
Creates a filter that matches documents where the value of the specified field matches the specified regular expression pattern.- Parameters:
value- the regular expression pattern to match against the value of the specified field- Returns:
- a filter that matches documents where the value of the specified field matches the specified regular expression pattern
-
in
Creates a filter that matches documents where the value of the field is in the specified array of values.- Parameters:
values- the array of values to match against- Returns:
- the filter object representing the filter
-
notIn
Creates a filter that matches documents where the value of the field is not in the specified array of values.- Parameters:
values- the array of values to compare against- Returns:
- a filter that matches documents where the value of the field is not in the specified array of values
-
elemMatch
Creates a filter that matches documents where the value of a field contains at least one element that matches the specified filter.- Parameters:
filter- the filter to apply to the matching elements- Returns:
- a filter that matches documents where the value of a field contains at least one element that matches the specified filter
-