use async_trait::async_trait;
use ecat_errors::Error;
#[async_trait]
pub trait DocumentClient: Send + Sync {
async fn insert(&self, collection: &str, doc: &serde_json::Value) -> Result<String, Error>;
async fn find(
&self,
collection: &str,
filter: &serde_json::Value,
) -> Result<Vec<serde_json::Value>, Error>;
async fn update(
&self,
collection: &str,
filter: &serde_json::Value,
update: &serde_json::Value,
) -> Result<u64, Error>;
async fn delete(&self, collection: &str, filter: &serde_json::Value) -> Result<u64, Error>;
}