pub struct QueryBuilder { /* private fields */ }Expand description
Builder for constructing complex queries
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn eq(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn eq(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add an equality filter (Eq operator)
Sourcepub fn ne(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn ne(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add a not-equal filter (Ne operator)
Sourcepub fn gt(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn gt(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add a greater-than filter (Gt operator)
Sourcepub fn gte(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn gte(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add a greater-than-or-equal filter (Gte operator)
Sourcepub fn lt(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn lt(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add a less-than filter (Lt operator)
Sourcepub fn lte(self, field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn lte(self, field: impl Into<String>, value: impl Into<Value>) -> Self
Add a less-than-or-equal filter (Lte operator)
Sourcepub fn in_array(self, field: impl Into<String>, values: Vec<Value>) -> Self
pub fn in_array(self, field: impl Into<String>, values: Vec<Value>) -> Self
Add an in-array filter (In operator)
Sourcepub fn nin(self, field: impl Into<String>, values: Vec<Value>) -> Self
pub fn nin(self, field: impl Into<String>, values: Vec<Value>) -> Self
Add a not-in-array filter (NotIn operator)
Sourcepub fn contains(
self,
field: impl Into<String>,
substring: impl Into<String>,
) -> Self
pub fn contains( self, field: impl Into<String>, substring: impl Into<String>, ) -> Self
Add a contains filter (substring match)
Sourcepub fn starts_with(
self,
field: impl Into<String>,
prefix: impl Into<String>,
) -> Self
pub fn starts_with( self, field: impl Into<String>, prefix: impl Into<String>, ) -> Self
Add a starts-with filter
Sourcepub fn ends_with(
self,
field: impl Into<String>,
suffix: impl Into<String>,
) -> Self
pub fn ends_with( self, field: impl Into<String>, suffix: impl Into<String>, ) -> Self
Add an ends-with filter
Sourcepub fn regex(self, field: impl Into<String>, pattern: impl Into<String>) -> Self
pub fn regex(self, field: impl Into<String>, pattern: impl Into<String>) -> Self
Add a regex filter (Note: not directly supported by server, use contains/starts_with/ends_with instead)
Sourcepub fn raw_filter(self, filter: Value) -> Self
pub fn raw_filter(self, filter: Value) -> Self
Add a raw filter expression
Sourcepub fn page(self, page: usize, page_size: usize) -> Self
pub fn page(self, page: usize, page_size: usize) -> Self
Set page number and page size (convenience method)
Sourcepub fn bypass_cache(self, bypass: bool) -> Self
pub fn bypass_cache(self, bypass: bool) -> Self
Bypass cache for this query
Sourcepub fn bypass_ripple(self, bypass: bool) -> Self
pub fn bypass_ripple(self, bypass: bool) -> Self
Bypass ripple propagation for this query
Sourcepub fn select_fields(self, fields: Vec<String>) -> Self
pub fn select_fields(self, fields: Vec<String>) -> Self
Select specific fields to return (plus ‘id’ which is always included)
Sourcepub fn exclude_fields(self, fields: Vec<String>) -> Self
pub fn exclude_fields(self, fields: Vec<String>) -> Self
Exclude specific fields from results
Trait Implementations§
Source§impl Clone for QueryBuilder
impl Clone for QueryBuilder
Source§fn clone(&self) -> QueryBuilder
fn clone(&self) -> QueryBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more