diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index a2c97d6553..e3f0e9c548 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -1018,7 +1018,7 @@ class MongoModuleStore(ModuleStoreWriteBase): :param wiki_slug: the course wiki root slug :return: list of course locations """ - courses = self.collection.find({'definition.data.wiki_slug': wiki_slug}) + courses = self.collection.find({'_id.category': 'course', 'definition.data.wiki_slug': wiki_slug}) # the course's run == its name. It's the only xblock for which that's necessarily true. return [Location._from_deprecated_son(course['_id'], course['_id']['name']) for course in courses] diff --git a/mongo_indexes.md b/mongo_indexes.md index 544b4186e7..3eb57438df 100644 --- a/mongo_indexes.md +++ b/mongo_indexes.md @@ -25,7 +25,7 @@ fs.files: Index needed thru 'category' by `_get_all_content_for_course` and others. That query also takes a sort which can be `uploadDate`, `display_name`, -# again, uploadDate may also be a freq sort. + ``` ensureIndex({'_id.tag': 1, '_id.org': 1, '_id.course': 1, '_id.category': 1}) ```