async fn delete(&self, db: Database) -> Result<DeleteResult> {
        let id = self
            .id()
            .ok_or_else(|| error::Error::ModelIdRequiredForOperation)?;

        Ok(Self::collection(db)
            .delete_one(doc! {"_id": id}, None)
            .await?)
    }
/// Delete this model instance by ID.
/// Returns error if ID is null.
Delete this model instance by ID.
Returns error if ID is null.
Delete this model instance by ID . Returns error if ID is null .
async fn delete(&self, db: Database) -> Result<DeleteResult> {
        let id = self
            .id()
            .ok_or_else(|| error::Error::ModelIdRequiredForOperation)?;
        Ok(Self::collection(db)
            .delete_one(doc! {"_id": id}, None)
            .await?)
    }
async fn delete ( & self , db : Database ) -> Result < DeleteResult > { let id = self . id ( ) . ok_or_else ( | | error :: Error :: ModelIdRequiredForOperation ) ? ; Ok ( Self :: collection ( db ) . delete_one ( doc ! { " " id } , None ) . await ? ) }
Delete this model instance by ID.
Delete this model instance by ID .
&self
db
Database
&self
db
Database