Fix deprecated API for Mongo driver