migration to JS engine #1

Merged
akulij merged 131 commits from dev into main 2025-05-31 08:49:52 +00:00
Showing only changes of commit 9c15b0a375 - Show all commits

View File

@ -12,7 +12,7 @@ use futures::stream::TryStreamExt;
use mongodb::options::IndexOptions;
use mongodb::{bson::doc, options::ClientOptions, Client};
use mongodb::{Database, IndexModel};
use mongodb::{Collection, Database, IndexModel};
use serde::{Deserialize, Serialize};
#[derive(EnumStringify)]
@ -193,6 +193,14 @@ impl DB {
}
}
pub trait DbCollection {
const COLLECTION: &str;
}
pub trait GetCollection {
async fn get_collection<C: DbCollection + Send + Sync>(&mut self) -> Collection<C>;
}
#[async_trait]
impl CallDB for DB {
async fn get_database(&mut self) -> Database {