conversion from mongoose schema needs to be able to handle 'type' fields as well