[][src]Trait avocado::db::DatabaseExt

pub trait DatabaseExt: ThreadedDatabase {
    fn existing_collection<T: Doc>(&self) -> Collection<T> { ... }
fn empty_collection<T>(&self) -> Result<Collection<T>>
    where
        T: Doc + BsonSchema,
        Uid<T>: BsonSchema
, { ... }
fn empty_collection_novalidate<T: Doc>(&self) -> Result<Collection<T>> { ... } }

Methods augmenting MongoDB ThreadedDatabase types.

Provided methods

fn existing_collection<T: Doc>(&self) -> Collection<T>

Returns an existing collection without dropping/recreating it.

fn empty_collection<T>(&self) -> Result<Collection<T>> where
    T: Doc + BsonSchema,
    Uid<T>: BsonSchema

Creates a fresh, empty collection. Drops any existing collection with the same name. Recreates the collection with the $jsonSchema validator based on the BsonSchema impl of the document type. Also creates indexes specified via the T::indexes() method.

fn empty_collection_novalidate<T: Doc>(&self) -> Result<Collection<T>>

Creates a fresh, empty collection. Drops any existing collection with the same name. Recreates the collection without the BSON schema validator. Also creates indexes specified via the T::indexes() method.

Loading content...

Implementors

impl<T: ThreadedDatabase> DatabaseExt for T
[src]

fn existing_collection<T: Doc>(&self) -> Collection<T>
[src]

fn empty_collection<T>(&self) -> Result<Collection<T>> where
    T: Doc + BsonSchema,
    Uid<T>: BsonSchema
[src]

fn empty_collection_novalidate<T: Doc>(&self) -> Result<Collection<T>>
[src]

Loading content...