[][src]Function mongodb_base_service::get_selected_or_first

pub fn get_selected_or_first<T>(
    selected: &Option<ID>,
    list: &Option<Vec<T>>
) -> Option<T> where
    T: Clone + Node

Returns the first item in an array of Nodes Useful for when you have two fields one that is embedded in a list and one that is not ie. my_pets and favorite_pet - you probably don't want to embed it twice