Update mongodb calls to avoid errors and warnings