Quick start

Add dependency

[dependencies]
musty = "0.0.0"

Model your data struct

#![allow(unused)]
fn main() {
use musty::prelude::*;

#[model(mongo())]
struct User {
    #[musty(get_by)]
    name: String
}
}

Save/query your model

...

#[tokio::main]
async fn main() -> musty::Result<()> {
    let db = ...

    let mut user = User::new("alex"); // fn generated by macro
    user.save(&db).await?;

    let mut user = User::get_by_name("alex").await?; // generated by #[musty(get_by)]
    user.delete(&db).await?;
}