pub trait Model: Serialize + DeserializeOwned + Unpin + Sync + Sized + Send + Default + Clone + Debug {
Show 18 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: 'async_trait { ... }
fn name() -> String { ... }
fn generate_id() -> 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: '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: 'async_trait,
'life0: 'async_trait { ... }
fn read<'async_trait>(
filter: Document
) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>
where Self: '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: '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: 'async_trait { ... }
fn update<'async_trait>(
filter: Document,
updates: Document
) -> Pin<Box<dyn Future<Output = Result<Self, MongooseError>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
fn bulk_update<'async_trait>(
filter: Document,
updates: Document
) -> Pin<Box<dyn Future<Output = Result<UpdateResult, MongooseError>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
fn delete<'async_trait>(
filter: Document
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
fn bulk_delete<'async_trait>(
filter: Document
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, MongooseError>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
fn count<'async_trait>(
filter: Option<Document>
) -> Pin<Box<dyn Future<Output = Result<u64, MongooseError>> + Send + 'async_trait>>
where Self: '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: 'async_trait,
'life0: 'async_trait { ... }
}