From 5a4a6331ab71fc6c9c980dc9eb7a4f7675cd6b93 Mon Sep 17 00:00:00 2001 From: Sun Wei Date: Fri, 17 Mar 2017 09:49:47 +0800 Subject: [PATCH] Update item-pipeline.rst insert is deprecated, use insert_one instead. --- docs/topics/item-pipeline.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/item-pipeline.rst b/docs/topics/item-pipeline.rst index 8c7aa361f..091f80924 100644 --- a/docs/topics/item-pipeline.rst +++ b/docs/topics/item-pipeline.rst @@ -156,7 +156,7 @@ method and how to clean up the resources properly.:: self.client.close() def process_item(self, item, spider): - self.db[self.collection_name].insert(dict(item)) + self.db[self.collection_name].insert_one(dict(item)) return item .. _MongoDB: https://www.mongodb.org/