How open edx stores course content data in mongo database?

4.4k views Asked by At

I am working on online course ware website which is similar to open edx.

Course ware data is stored in mongo database, I want to find out amount of disk space taken by each course.

The database is edxapp which contains following collections: 1. modulestore 2. fs.files 3. fs.chunks

2

There are 2 answers

0
Éder Henrique Franco On BEST ANSWER

Use: edxapp

db.modulestore.find( { "_id.category" : "course" }, {'name':'1'} )

Take a look at this page, in the section Mongo: https://github.com/edx/edx-platform/wiki/Shell-commands

0
Brandon C On

Recently, the Open edX modulestore was split into three sections.

use edxapp

To see the courses:

db.modulestore.active_versions.find().pretty()

To see the course structure which contains the course itself, sections, subsections, and units as blocks:

db.modulestore.structures.find().pretty()

Finally, to see the course definitions which contain the actual HTML content of the units:

db.modulestore.definitions.find().pretty()  

In order to check the size of any of those collections, simply run:

db.<collection.name>.stats()

This will output the storageSize of the collection.