update mongo sample code