convert from mongodb to orm