replaced obsolete methods of MongoDB driver