async createIndex() {
    const collection = this.dbManager.dbo.collection(this.getTableName());
    const indexObject = {};
    const keyColumns = this.getRowClass().getKeyColumns();
    for (const column of keyColumns) {
      indexObject[column] = 1;
    }

    await collection.createIndex(indexObject, { unique: true });

    const uniqueIndices = this.getRowClass().getUniqueIndices();
    for (const index of uniqueIndices) {
      const uniqueIndexObject = {};
      for (const column of index) {
        uniqueIndexObject[column] = 1;
      }

      if (!OhUtils.isEmpty(uniqueIndexObject)) {
        await collection.createIndex(uniqueIndexObject, { unique: true });
      }
    }
  }
/**
   * Created necessary indices for the collection.
   * @return {Promise} nothing
   */
Created necessary indices for the collection.
@return {Promise} nothing
Created necessary indices for the collection . @return { Promise } nothing
async createIndex() {
    const collection = this.dbManager.dbo.collection(this.getTableName());
    const indexObject = {};
    const keyColumns = this.getRowClass().getKeyColumns();
    for (const column of keyColumns) {
      indexObject[column] = 1;
    }
    await collection.createIndex(indexObject, { unique: true });
    const uniqueIndices = this.getRowClass().getUniqueIndices();
    for (const index of uniqueIndices) {
      const uniqueIndexObject = {};
      for (const column of index) {
        uniqueIndexObject[column] = 1;
      }
      if (!OhUtils.isEmpty(uniqueIndexObject)) {
        await collection.createIndex(uniqueIndexObject, { unique: true });
      }
    }
  }
async createIndex ( ) { const collection = this . dbManager . dbo . collection ( this . getTableName ( ) ) ; const indexObject = { } ; const keyColumns = this . getRowClass ( ) . getKeyColumns ( ) ; for ( const column of keyColumns ) { indexObject [ column ] = 1 ; } await collection . createIndex ( indexObject , { unique : true } ) ; const uniqueIndices = this . getRowClass ( ) . getUniqueIndices ( ) ; for ( const index of uniqueIndices ) { const uniqueIndexObject = { } ; for ( const column of index ) { uniqueIndexObject [ column ] = 1 ; } if ( ! OhUtils . isEmpty ( uniqueIndexObject ) ) { await collection . createIndex ( uniqueIndexObject , { unique : true } ) ; } } }
Created necessary indices for the collection.
Created necessary indices for the collection .