[][src]Struct mongodb_helper::Database

pub struct Database {
    pub db: Pool<MongodbConnectionManager>,
}

Fields

db: Pool<MongodbConnectionManager>

Methods

impl Database[src]

pub fn aggregate<R>(
    &self,
    collection: String,
    pipeline: Vec<Document>,
    options: Option<AggregateOptions>
) -> Result<Vec<R>, String> where
    R: Deserialize<'r>, 
[src]

impl Database[src]

pub fn find<R>(
    &self,
    collection: String,
    filter: Option<Document>,
    options: Option<FindOptions>
) -> Result<Vec<R>, String> where
    R: Deserialize<'r>, 
[src]

impl Database[src]

pub fn insert_one<D, R>(
    &self,
    collection: String,
    document: D,
    write_concern: Option<WriteConcern>
) -> Result<R, String> where
    D: Serialize + Debug,
    R: Deserialize<'r>, 
[src]

impl Database[src]

pub fn find_one_and_update<R>(
    &self,
    collection: String,
    filter: Document,
    update: Document,
    options: Option<FindOneAndUpdateOptions>
) -> Result<R, String> where
    R: Deserialize<'r>, 
[src]

impl Database[src]

pub fn find_one_and_delete<R>(
    &self,
    collection: String,
    filter: Document,
    options: Option<FindOneAndDeleteOptions>
) -> Result<R, String> where
    R: Deserialize<'r>, 
[src]

impl Database[src]

pub fn delete_many(
    &self,
    collection: String,
    filter: Document,
    write_concern: Option<WriteConcern>
) -> Result<i32, String>
[src]

impl Database[src]

pub fn update_many(
    &self,
    collection: String,
    filter: Document,
    update: Document,
    options: Option<UpdateOptions>
) -> Result<i32, String>
[src]

Trait Implementations

impl Clone for Database[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Database

impl Sync for Database

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

impl<T> Same<T> for T

type Output = T

Should always be Self