diff options
author | cedricbonhomme <devnull@localhost> | 2012-05-01 18:18:28 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-05-01 18:18:28 +0200 |
commit | 864d8a49934894fe59ed89517063f1c05d6fb0fc (patch) | |
tree | ae46d3115adda02f27ac2ab776526169d137557f /source/mongodb.py | |
parent | Speed improvement. (diff) | |
download | newspipe-864d8a49934894fe59ed89517063f1c05d6fb0fc.tar.gz newspipe-864d8a49934894fe59ed89517063f1c05d6fb0fc.tar.bz2 newspipe-864d8a49934894fe59ed89517063f1c05d6fb0fc.zip |
It is now possible to update information about a feed with the MongoDG database.
Diffstat (limited to 'source/mongodb.py')
-rw-r--r-- | source/mongodb.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/mongodb.py b/source/mongodb.py index b3527794..7bb5c841 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -186,6 +186,13 @@ class Articles(object): for feed_id in self.db.collection_names(): self.mark_as_read(readed, feed_id, None) + def update_feed(self, feed_id, changes): + """ + Update a feed. + """ + collection = self.db[str(feed_id)] + collection.update({"type": 0, "feed_id":feed_id}, {"$set": changes}, multi=True) + def list_collections(self): """ List all collections (feed). |