Trait mongoose::Model

source ·
pub trait Modelwhere
    Self: Serialize + DeserializeOwned + Unpin + Sync + Sized + Send + Default + Clone + Debug,{
Show 20 methods // Provided methods fn client<'async_trait>( ) -> Pin<Box<dyn Future<Output = &'static Client> + Send + 'async_trait>> { ... } fn database<'async_trait>( ) -> Pin<Box<dyn Future<Output = &'static Database> + Send + 'async_trait>> { ... } fn collection<'async_trait>( ) -> Pin<Box<dyn Future<Output = Collection<Self>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn name() -> String { ... } fn generate_nanoid() -> String { ... } fn create_pipeline(pipeline: &[PipelineStage]) -> Vec<Document> { ... } fn normalize_updates(updates: &Document) -> Document { ... } fn save<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn bulk_insert<'life0, 'async_trait>( docs: &'life0 [Self] ) -> Pin<Box<dyn Future<Output = Result<InsertManyResult, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn read<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn read_by_id<'life0, 'async_trait>( id: &'life0 str ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn list<'async_trait>( filter: Option<Document>, options: Option<ListOptions> ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn update<'async_trait>( filter: Document, updates: Document ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn bulk_update<'async_trait>( filter: Document, updates: Document ) -> Pin<Box<dyn Future<Output = Result<UpdateResult, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn delete<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn bulk_delete<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn count<'async_trait>( filter: Option<Document> ) -> Pin<Box<dyn Future<Output = Result<u64, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } fn aggregate_raw<'async_trait, T>( pipeline: Vec<Document> ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, MongooseError>> + Send + 'async_trait>> where T: 'async_trait + DeserializeOwned + Send, Self: Send + 'async_trait { ... } fn aggregate<'life0, 'async_trait, T>( pipeline: &'life0 [PipelineStage] ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, MongooseError>> + Send + 'async_trait>> where T: 'async_trait + DeserializeOwned + Send, Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn create_indexes<'life0, 'async_trait>( options: &'life0 [IndexModel] ) -> Pin<Box<dyn Future<Output = Result<CreateIndexesResult, MongooseError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... }
}

Provided Methods§

source

fn client<'async_trait>( ) -> Pin<Box<dyn Future<Output = &'static Client> + Send + 'async_trait>>

source

fn database<'async_trait>( ) -> Pin<Box<dyn Future<Output = &'static Database> + Send + 'async_trait>>

source

fn collection<'async_trait>( ) -> Pin<Box<dyn Future<Output = Collection<Self>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn name() -> String

source

fn generate_nanoid() -> String

source

fn create_pipeline(pipeline: &[PipelineStage]) -> Vec<Document>

source

fn normalize_updates(updates: &Document) -> Document

source

fn save<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source

fn bulk_insert<'life0, 'async_trait>( docs: &'life0 [Self] ) -> Pin<Box<dyn Future<Output = Result<InsertManyResult, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn read<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn read_by_id<'life0, 'async_trait>( id: &'life0 str ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn list<'async_trait>( filter: Option<Document>, options: Option<ListOptions> ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn update<'async_trait>( filter: Document, updates: Document ) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn bulk_update<'async_trait>( filter: Document, updates: Document ) -> Pin<Box<dyn Future<Output = Result<UpdateResult, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn delete<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn bulk_delete<'async_trait>( filter: Document ) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn count<'async_trait>( filter: Option<Document> ) -> Pin<Box<dyn Future<Output = Result<u64, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait,

source

fn aggregate_raw<'async_trait, T>( pipeline: Vec<Document> ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, MongooseError>> + Send + 'async_trait>>where T: 'async_trait + DeserializeOwned + Send, Self: Send + 'async_trait,

source

fn aggregate<'life0, 'async_trait, T>( pipeline: &'life0 [PipelineStage] ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, MongooseError>> + Send + 'async_trait>>where T: 'async_trait + DeserializeOwned + Send, Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn create_indexes<'life0, 'async_trait>( options: &'life0 [IndexModel] ) -> Pin<Box<dyn Future<Output = Result<CreateIndexesResult, MongooseError>> + Send + 'async_trait>>where Self: Send + 'async_trait, 'life0: 'async_trait,

Implementors§