[−][src]Struct ejdb::query::Q
An entry point for constructing queries.
This is a convenience API. This structure provides the same methods as Query
structure and inside them a fresh Query
instance is created and the corresponding
method is called on it. This is the main approach for constructing queries.
Example
use ejdb::query::{Query, Q}; assert_eq!( Query::new().field("name").eq("Foo").inc("rating", 1).set("favorite", true), Q.field("name").eq("Foo").inc("rating", 1).set("favorite", true) )
Methods
impl Q
[src]
pub fn empty(self) -> Query
[src]
pub fn and<I>(self, queries: I) -> Query where
I: IntoIterator,
I::Item: Into<Document>,
[src]
I: IntoIterator,
I::Item: Into<Document>,
pub fn or<I>(self, queries: I) -> Query where
I: IntoIterator,
I::Item: Into<Document>,
[src]
I: IntoIterator,
I::Item: Into<Document>,
pub fn id<V: Into<Bson>>(self, value: V) -> Query
[src]
pub fn field<S: Into<String>>(self, name: S) -> FieldConstraint
[src]
pub fn join<S: Into<String>, C: Into<String>>(self, key: S, coll: C) -> Query
[src]
pub fn add_to_set<S: Into<String>, V: Into<Bson>>(
self,
key: S,
value: V
) -> Query
[src]
self,
key: S,
value: V
) -> Query
pub fn add_to_set_all<S, I>(self, key: S, values: I) -> Query where
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
[src]
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
pub fn unset<S: Into<String>>(self, key: S) -> Query
[src]
pub fn inc<S: Into<String>, D: BsonNumber>(self, key: S, delta: D) -> Query
[src]
pub fn drop_all(self) -> Query
[src]
pub fn upsert_many<D: Into<Document>>(self, document: D) -> Query
[src]
pub fn upsert<S: Into<String>, V: Into<Bson>>(self, key: S, value: V) -> Query
[src]
pub fn set<S: Into<String>, V: Into<Bson>>(self, key: S, value: V) -> Query
[src]
pub fn set_many<D: Into<Document>>(self, document: D) -> Query
[src]
pub fn pull<S: Into<String>, V: Into<Bson>>(self, key: S, value: V) -> Query
[src]
pub fn pull_all<S, I>(self, key: S, values: I) -> Query where
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
[src]
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
pub fn push<S: Into<String>, V: Into<Bson>>(self, key: S, value: V) -> Query
[src]
pub fn push_all<S, I>(self, key: S, values: I) -> Query where
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
[src]
S: Into<String>,
I: IntoIterator,
I::Item: Into<Bson>,
pub fn rename<S1: Into<String>, S2: Into<String>>(
self,
key: S1,
new_key: S2
) -> Query
[src]
self,
key: S1,
new_key: S2
) -> Query
pub fn slice<S: Into<String>>(self, key: S, limit: i64) -> Query
[src]
pub fn slice_with_offset<S: Into<String>>(
self,
key: S,
offset: i64,
limit: i64
) -> Query
[src]
self,
key: S,
offset: i64,
limit: i64
) -> Query
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,