mongo_crud_core 0.1.0

A simple library to extract the mongoDB fetching process. Only for basic types.
Documentation
1
2
3
4
5
6
7
8
9
10
use async_trait::async_trait;

#[async_trait]
pub trait MongoCrud {
    async fn insert(&self, ctx: &(impl crate::MongoContext + Sync)) -> bool;
    async fn update(&self, ctx: &(impl crate::MongoContext + Sync)) -> bool;
    async fn delete(&self, ctx: &(impl crate::MongoContext + Sync)) -> bool;
    async fn find(&self, ctx: &(impl crate::MongoContext + Sync), id: &str) -> Self;
    async fn find_all(&self, ctx: &(impl crate::MongoContext + Sync), filter: mongodb::bson::Document) -> Vec<Box<Self>>;
}