pub struct Query { /* private fields */ }Expand description
Query builder for Automerge documents
Provides a fluent API for building queries with filtering, sorting, and pagination.
Implementations§
Source§impl Query
impl Query
Sourcepub fn new(store: Arc<AutomergeStore>, collection_name: &str) -> Query
pub fn new(store: Arc<AutomergeStore>, collection_name: &str) -> Query
Create a new query for a collection
§Arguments
store- AutomergeStore containing the documentscollection_name- Name of the collection to query
Sourcepub fn where_gt(self, field: &str, value: Value) -> Query
pub fn where_gt(self, field: &str, value: Value) -> Query
Filter where field is greater than value
Sourcepub fn where_lt(self, field: &str, value: Value) -> Query
pub fn where_lt(self, field: &str, value: Value) -> Query
Filter where field is less than value
Sourcepub fn where_gte(self, field: &str, value: Value) -> Query
pub fn where_gte(self, field: &str, value: Value) -> Query
Filter where field is greater than or equal to value
Sourcepub fn where_lte(self, field: &str, value: Value) -> Query
pub fn where_lte(self, field: &str, value: Value) -> Query
Filter where field is less than or equal to value
Sourcepub fn where_contains(self, field: &str, value: Value) -> Query
pub fn where_contains(self, field: &str, value: Value) -> Query
Sourcepub fn filter_by_ids(self, ids: &[String]) -> Query
pub fn filter_by_ids(self, ids: &[String]) -> Query
Sourcepub fn execute(self) -> Result<Vec<(String, Automerge)>, Error>
pub fn execute(self) -> Result<Vec<(String, Automerge)>, Error>
Execute the query and return matching documents
Returns (doc_id, Automerge) tuples for all matching documents.
Auto Trait Implementations§
impl Freeze for Query
impl !RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl !UnwindSafe for Query
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more