Trait MongoRepository
Source pub trait MongoRepository<E> {
Show 13 methods
// Required methods
fn find_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<E>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 E,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn insert_many<'life0, 'life1, 'async_trait>(
&'life0 self,
entities: &'life1 [E],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
update: Document,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_one_by<'life0, 'async_trait>(
&'life0 self,
filter: Document,
update: Document,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_many<'life0, 'async_trait>(
&'life0 self,
filter: Document,
update: Document,
) -> Pin<Box<dyn Future<Output = (u64, u64)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find<'life0, 'async_trait>(
&'life0 self,
option: FindOption,
) -> Pin<Box<dyn Future<Output = Vec<E>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_one_by<'life0, 'async_trait>(
&'life0 self,
filter: Document,
) -> Pin<Box<dyn Future<Output = Option<E>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count<'life0, 'async_trait>(
&'life0 self,
filter: Option<Document>,
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn exists<'life0, 'async_trait>(
&'life0 self,
filter: Document,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_by<'life0, 'async_trait>(
&'life0 self,
filter: Document,
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn aggregate<'life0, 'async_trait>(
&'life0 self,
stages: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Vec<Document>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}