aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/mongodb.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/mongodb.py b/source/mongodb.py
index 8d1a4848..8d07bf38 100644
--- a/source/mongodb.py
+++ b/source/mongodb.py
@@ -55,8 +55,11 @@ class Articles(object):
"""
collection = self.db[str(feed_id)]
- collection.create_index([("article_date", pymongo.DESCENDING)], \
+ try:
+ collection.create_index([("article_date", pymongo.DESCENDING)], \
{"unique":False, "sparse":False})
+ except:
+ print "Oups"
for article in articles:
cursor = collection.find({"article_id":article["article_id"]})
bgstack15