docs: function search(query, options = {}) {
    const {
      format = 'idCode',
      mode = 'substructure',
      flattenResult = true,
      keepMolecule = false,
      limit = Number.MAX_SAFE_INTEGER
    } = options;
  
    if (typeof query === 'string') {
      const getMoleculeCreators = require('./moleculeCreators');
      const moleculeCreators = getMoleculeCreators(this.OCL.Molecule);
      query = moleculeCreators.get(format.toLowerCase())(query);
    } else if (!(query instanceof this.OCL.Molecule)) {
      throw new TypeError('toSearch must be a Molecule or string');
    }
  
    let result;
    switch (mode.toLowerCase()) {
      case 'exact':
        result = exactSearch(this.moleculeDB.db, query, limit);
        break;
      case 'substructure':
        result = subStructureSearch(this.moleculeDB, query, limit);
        break;
      case 'similarity':
        result = similaritySearch(this.moleculeDB, this.OCL, query, limit);
        break;
      default:
        throw new Error(`unknown search mode: ${options.mode}`);
    }
    return processResult(result, { flattenResult, keepMolecule, limit });
  }