mongodb initial conversion

added email func