Fix and test mongo update method