diff --git a/luigi/contrib/mongodb.py b/luigi/contrib/mongodb.py index 7e4a6069bf..cedfe8525c 100644 --- a/luigi/contrib/mongodb.py +++ b/luigi/contrib/mongodb.py @@ -190,7 +190,7 @@ def read(self): """ Return if the target collection exists in the database """ - return self._collection in self.get_index().collection_names() + return self._collection in self.get_index().list_collection_names() class MongoCountTarget(MongoTarget): diff --git a/pyproject.toml b/pyproject.toml index 8265c02afe..60397cb2e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ common = [ "psutil<4.0", "pygments", "pyhive[presto]==0.6.1", - "pymongo==3.4.0", + "pymongo>=4.15.1", "pytest", "pytest-cov", "requests>=2.20.0,<=2.31.0",