update mongo api to replace deprecated code

I need to update some part of the code to be able to use the native mongo php module.