[][src]Struct ejdb::query::Q

pub struct 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]

pub fn or<I>(self, queries: I) -> Query where
    I: IntoIterator,
    I::Item: Into<Document>, 
[src]

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]

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]

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]

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]

pub fn rename<S1: Into<String>, S2: Into<String>>(
    self,
    key: S1,
    new_key: S2
) -> Query
[src]

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]

Auto Trait Implementations

impl Send for Q

impl Sync for Q

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Err = <U as TryFrom<T>>::Err