Modified to update mongo in place