pub trait GridFSDb: MongoClient {
    fn create_bucket(&self) -> GridFSBucket { ... }
}
Expand description

Trait that is implemented automatically on all Database handlers.

Feature flag “mongodb-gridfs” is needed to use this trait.

use mongodb_ext::{mongo_db, GridFSDb, MongoClient};
use mongodb_gridfs::GridFSBucket;
use tokio_test::block_on;

mongo_db! {
    SomeDatabase {
        SomeCollection {
            some_field: String
        }
    }
}

use mongo::SomeDatabase;

// using `tokio::block_on` to run async code in tests
let db: SomeDatabase = block_on(SomeDatabase::new("mongodb://example.com")).unwrap();
let bucket: GridFSBucket = db.create_bucket();

Provided methods

Creates a mongodb GridFS bucket.

Implementors