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 102fae25c7 - Show all commits

View File

@ -48,4 +48,10 @@ impl BotInstance {
Ok(bi.find(doc! {}).await?.try_collect().await?) Ok(bi.find(doc! {}).await?.try_collect().await?)
} }
pub async fn get_by_name<D: CallDB>(db: &mut D, name: &str) -> DbResult<Option<Self>> {
let bi = db.get_collection::<Self>().await;
Ok(bi.find_one(doc! {"name": name}).await?)
}
} }