pub trait Converters {
    fn to_prepared_doc(
        doc: Document,
        ignore_fields: &[String],
        field_type_map: &HashMap<String, String>,
        model_name: &str
    ) -> Result<Document, Box<dyn Error>> { ... } fn one_to_json_val(
        db_doc: Document,
        ignore_fields: &[String],
        field_type_map: &HashMap<String, String>,
        model_name: &str,
        fields_name: &Vec<String>,
        model_json: &mut Value
    ) -> Result<(), Box<dyn Error>> { ... } fn many_to_doc_list(
        filter: Option<Document>,
        find_options: Option<FindOptions>,
        collection: Collection
    ) -> Result<Vec<Document>, Box<dyn Error>> { ... } fn many_to_json(
        filter: Option<Document>,
        find_options: Option<FindOptions>,
        collection: Collection,
        ignore_fields: &[String],
        field_type_map: &HashMap<String, String>,
        model_name: &str
    ) -> Result<Option<String>, Box<dyn Error>> { ... } }
Expand description

Helper methods for converting output data (use in the commons.rs module).

Provided Methods

Get prepared document ( converting data types to model-friendly formats ).

In the model instance, in the format serde_json::Value, Update the field type values from the corresponding document from the database.

Get prepared documents ( missing fields type ).

Get json-line from document list ( missing fields type ).

Implementors