mongo db generics functions wrapper