Update item-pipeline.rst

insert is deprecated, use insert_one instead.
This commit is contained in:
Sun Wei 2017-03-17 09:49:47 +08:00 committed by GitHub
parent 958554473c
commit 5a4a6331ab
1 changed files with 1 additions and 1 deletions

View File

@ -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/