code: def create_index(self, collection, index_name, **kwargs):
          
          try:
              self.connection[collection].create_index(index_name, **kwargs)
          except Exception as exc:
              LOG.warn("Error tuning mongodb database: %s", exc)
docs: Safely attempt to create index.