idkthings_core 0.1.0

core stuff for idkthings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use mongodb::options::ClientOptions;
use mongodb::Client;
use std::env;

pub async fn create_db_client() -> Client {
    let connection_string = env::var("DB_CONNECTION_STRING").expect("DB_CONNECTION_STRING not set");

    let client_options = ClientOptions::parse(connection_string).await.unwrap();
    let client = Client::with_options(client_options).expect("failed to connect to db");

    client
}