function fixSubIndexPaths(schema, prefix) {
    const subindexes = schema._indexes;
    const len = subindexes.length;
    for (let i = 0; i < len; ++i) {
      const indexObj = subindexes[i][0];
      const indexOptions = subindexes[i][1];
      const keys = Object.keys(indexObj);
      const klen = keys.length;
      const newindex = {};

      // use forward iteration, order matters
      for (let j = 0; j < klen; ++j) {
        const key = keys[j];
        newindex[prefix + key] = indexObj[key];
      }

      const newIndexOptions = Object.assign({}, indexOptions);
      if (indexOptions != null && indexOptions.partialFilterExpression != null) {
        newIndexOptions.partialFilterExpression = {};
        const partialFilterExpression = indexOptions.partialFilterExpression;
        for (const key of Object.keys(partialFilterExpression)) {
          newIndexOptions.partialFilterExpression[prefix + key] =
            partialFilterExpression[key];
        }
      }

      indexes.push([newindex, newIndexOptions]);
    }
  }
Checks for indexes added to subdocs using Schema.index().
These indexes need their paths prefixed properly.

schema._indexes = [ [indexObj, options], [indexObj, options] ..]
@param {Schema} schema
@param {String} prefix
@api private