Trait mongoose::Model

source ·
pub trait Model{
Show 19 methods // Provided methods async fn client() -> &'static Client { ... } async fn database() -> &'static Database { ... } async fn collection() -> Collection<Self> { ... } async fn create_view(source: impl ToString, pipeline: Vec<Document>) -> bool { ... } fn name() -> String { ... } fn generate_nanoid() -> String { ... } fn normalize_updates(updates: &Document) -> Document { ... } async fn save(&self) -> Result<Self, MongooseError> { ... } async fn bulk_insert( docs: &[Self] ) -> Result<InsertManyResult, MongooseError> { ... } async fn read(filter: Document) -> Result<Self, MongooseError> { ... } async fn read_by_id(id: impl ToString + Send) -> Result<Self, MongooseError> { ... } async fn list( filter: Document, options: ListOptions ) -> Result<Vec<Self>, MongooseError> { ... } async fn update( filter: Document, updates: Document ) -> Result<Self, MongooseError> { ... } async fn bulk_update( filter: Document, updates: Document ) -> Result<UpdateResult, MongooseError> { ... } async fn delete(filter: Document) -> Result<DeleteResult, MongooseError> { ... } async fn bulk_delete( filter: Document ) -> Result<DeleteResult, MongooseError> { ... } async fn count(filter: Option<Document>) -> Result<u64, MongooseError> { ... } async fn aggregate<T: DeserializeOwned + Send>( pipeline: Vec<Document> ) -> Result<Vec<T>, MongooseError> { ... } async fn create_indexes( options: &[IndexModel] ) -> Result<CreateIndexesResult, MongooseError> { ... }
}

Provided Methods§

source

async fn client() -> &'static Client

source

async fn database() -> &'static Database

source

async fn collection() -> Collection<Self>

source

async fn create_view(source: impl ToString, pipeline: Vec<Document>) -> bool

source

fn name() -> String

source

fn generate_nanoid() -> String

source

fn normalize_updates(updates: &Document) -> Document

source

async fn save(&self) -> Result<Self, MongooseError>

source

async fn bulk_insert(docs: &[Self]) -> Result<InsertManyResult, MongooseError>

source

async fn read(filter: Document) -> Result<Self, MongooseError>

source

async fn read_by_id(id: impl ToString + Send) -> Result<Self, MongooseError>

source

async fn list( filter: Document, options: ListOptions ) -> Result<Vec<Self>, MongooseError>

source

async fn update( filter: Document, updates: Document ) -> Result<Self, MongooseError>

source

async fn bulk_update( filter: Document, updates: Document ) -> Result<UpdateResult, MongooseError>

source

async fn delete(filter: Document) -> Result<DeleteResult, MongooseError>

source

async fn bulk_delete(filter: Document) -> Result<DeleteResult, MongooseError>

source

async fn count(filter: Option<Document>) -> Result<u64, MongooseError>

source

async fn aggregate<T: DeserializeOwned + Send>( pipeline: Vec<Document> ) -> Result<Vec<T>, MongooseError>

source

async fn create_indexes( options: &[IndexModel] ) -> Result<CreateIndexesResult, MongooseError>

Object Safety§

This trait is not object safe.

Implementors§