message: HF:  fix undefined terms in triggers search API
diff: @@ -26,7 +26,7 @@ export class TriggerManager {
  * @params options.fields {string} which fields to retrieve, defaults to 'full' version
  */
  static find(terms, options) {
  - terms = cleanTerms(terms) || {};
  + terms = translateFindTerms(terms);
  const {fields} = Object.assign({fields: 'full'}, options);
  return triggersDBService.db.find(terms)
  @@ -64,10 +64,14 @@ function cleanForOutput(trigger, fields) {
  return cleanTrigger;
  }
  -function cleanTerms(terms) {
  +function translateFindTerms(terms) {
  + if (!terms) {
  + return {};
  + }
  + terms = {...terms};
  if (terms.shim) {
  delete terms.shim;
  - terms["schema.shim"] = {$exists: true};
  + terms['schema.shim'] = { $exists: true };
  }
  return terms;
  }
  