pub fn update(table : &str, filter : bson::Document, set : bson::Document) -> Result<String, ApiError> {
    let coll = collection(table);
    let update_result = coll.update_one(filter, set, None);

    match update_result {
        Ok(_) => Ok("ok".to_string()),
        Err(e) => return Err(e).map_err(ApiError::DBError)
    }
}
/// Update User with filter and set query.
Update User with filter and set query.
Update User with filter and set query .
pub fn update(table : &str, filter : bson::Document, set : bson::Document) -> Result<String, ApiError> {
    let coll = collection(table);
    let update_result = coll.update_one(filter, set, None);
    match update_result {
        Ok(_) => Ok("ok".to_string()),
        Err(e) => return Err(e).map_err(ApiError::DBError)
    }
}
pub fn update ( table : & str , filter : bson :: Document , set : bson :: Document ) -> Result < String , ApiError > { let coll = collection ( table ) ; let update_result = coll . update_one ( filter , set , None ) ; match update_result { Ok ( _ ) => Ok ( " " . to_string ( ) ) , Err ( e ) => return Err ( e ) . map_err ( ApiError :: DBError ) } }
Update User with filter and set query.
Update User with filter and set query .
table
&str
filter
bson::Document
set
bson::Document