From 520fac1aa2d27b7f04e442b40b6e654f9e9f6a6a Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 29 Jun 2012 13:40:06 -0400 Subject: [PATCH] Enforce an index over the location key in mongo --- common/lib/keystore/mongo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/common/lib/keystore/mongo.py b/common/lib/keystore/mongo.py index 20c4ffde1a..4c50b634ea 100644 --- a/common/lib/keystore/mongo.py +++ b/common/lib/keystore/mongo.py @@ -15,6 +15,7 @@ class MongoModuleStore(ModuleStore): host=host, port=port )[db][collection] + self.collection.ensure_index('location') # Force mongo to report errors, at the expense of performance self.collection.safe = True