pub enum AdvancedFilter {
Show 14 variants
Equals {
property: Vec<String>,
value: QueryValue,
},
In {
property: Vec<String>,
values: QueryValue,
},
Range {
property: Vec<String>,
gte: Option<QueryValue>,
gt: Option<QueryValue>,
lte: Option<QueryValue>,
lt: Option<QueryValue>,
},
Prefix {
property: Vec<String>,
value: String,
},
Exists {
property: Vec<String>,
},
ContainsAny {
property: Vec<String>,
values: QueryValue,
},
ContainsAll {
property: Vec<String>,
values: QueryValue,
},
MatchAll {},
Nested {
scope: Vec<String>,
filter: Box<AdvancedFilter>,
},
Overlaps {
start_property: Vec<String>,
end_property: Vec<String>,
gte: Option<QueryValue>,
gt: Option<QueryValue>,
lte: Option<QueryValue>,
lt: Option<QueryValue>,
},
HasData(Vec<SourceReference>),
And(Vec<AdvancedFilter>),
Or(Vec<AdvancedFilter>),
Not(Box<AdvancedFilter>),
}Expand description
Advanced filter. The filter module contains useful tools for
building filters.
§Example
This creates a filter matching nodes where “prop” is 15 and externalId is not test, or “prop” is between 1 (inclusive) and 5 (exclusive)
use cognite::filter::*;
equals(["space", "view/1", "prop"], 15)
.and(not(equals(["node", "externalId"], "test")))
.or(range(["space", "view/1", "prop"], 1..5));Variants§
Equals
Require the value of property to be equal to value
In
Require the value to be in the list of values
Fields
values: QueryValueRight hand side list of values.
Range
Require the value to be greater than gt, greater than or equal to gte,
less than lt and less than or equal to lte
Fields
gte: Option<QueryValue>Greater than or equal to
gt: Option<QueryValue>Greater than
lte: Option<QueryValue>Less than or equal to
lt: Option<QueryValue>Less than
Prefix
Require the value to be text and start with value
Exists
Require this property to exist.
ContainsAny
Matches items where the property contains one or more of the given values. This filter can only be applied to multivalued properties.
ContainsAll
Matches items where the property contains all the given values. This filter can only be applied to multivalued properties.
MatchAll
An open filter that matches anything.
Nested
Use nested to apply the properties of the direct relation as the filter.
scope specifies the direct relation property you want use as the filtering property.
Fields
filter: Box<AdvancedFilter>Filter to apply to nested property.
Overlaps
Matches items where the range made up of the two properties overlap with the provided range.
Fields
gte: Option<QueryValue>Greater than or equal to
gt: Option<QueryValue>Greater than
lte: Option<QueryValue>Less than or equal to
lt: Option<QueryValue>Less than
HasData(Vec<SourceReference>)
Require items to have data in the referenced views, or containers.
And(Vec<AdvancedFilter>)
Require all these filters to match.
Or(Vec<AdvancedFilter>)
Require at least one of these filters to match.
Not(Box<AdvancedFilter>)
Require this filter not to match.
Implementations§
Source§impl AdvancedFilter
impl AdvancedFilter
Sourcepub fn and(self, filter: AdvancedFilter) -> Self
pub fn and(self, filter: AdvancedFilter) -> Self
Construct an and filter from this filter and another filter.
§Arguments
filter- AND with this filter.
Sourcepub fn or(self, filter: AdvancedFilter) -> Self
pub fn or(self, filter: AdvancedFilter) -> Self
Construct an or filter from this filter and another filter.
§Arguments
filter- OR with this filter.
Trait Implementations§
Source§impl Clone for AdvancedFilter
impl Clone for AdvancedFilter
Source§fn clone(&self) -> AdvancedFilter
fn clone(&self) -> AdvancedFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more