mongo-orm 0.3.0

A simple orm for mongodb
Documentation
#[macro_export]
macro_rules! mongo_entity {
    ($name:ident, { $($field_name:ident : $field_type:ty),* $(,)? }) => {
        #[derive(Debug, Serialize, Deserialize, PartialEq)]
        pub struct $name {
            #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
            pub id: Option<ObjectId>,
            $(pub $field_name: $field_type,)*
        }

        impl $name {
            // Constructor without ID
            pub fn new($($field_name: $field_type),*) -> Self {
                Self {
                    id: None,
                    $($field_name),*
                }
            }

            // Constructor with ID
            pub fn with_id(id: ObjectId, $($field_name: $field_type),*) -> Self {
                Self {
                    id: Some(id),
                    $($field_name),*
                }
            }
        }
    };
}