code: def _create_indexes(self):
          
          # WARNING: The collection will be locked during the index
          # creation. If the collection has a large number of
          # documents in it, the operation can take a long time.
  
          # TODO: The creation of indexes can be moved to a Django
          # management command or equivalent. There is also an option to
          # run the indexing on the background, without locking.
          self.collection.ensure_index([('time', pymongo.DESCENDING)])
          self.collection.ensure_index('name')
docs: Ensures the proper fields are indexed