Skip to content

Commit

Permalink
Merge pull request #80 from jgrigera/listcollections
Browse files Browse the repository at this point in the history
Change .collection_names to .listCollections
  • Loading branch information
grammy-jiang authored Aug 8, 2020
2 parents a11f9c4 + 4450cae commit 34a5740
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrapy_pipelines/pipelines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def open_spider(self, spider: Spider):
name=self.settings.get("PIPELINE_MONGO_USERNAME"),
)
try:
yield self.database.collection_names()
yield self.database.command("listCollections")
except OperationFailure as err:
LOGGER.error(str(err))
self.crawler.engine.close_spider(spider=spider, reason=str(err))
Expand Down

0 comments on commit 34a5740

Please sign in to comment.