How to use the Like function from typeorm

Find comprehensive JavaScript typeorm.Like code examples handpicked from public code repositorys.

17
18
19
20
21
22
23
24
25
    continue
  }

  if (Object.prototype.hasOwnProperty.call(filters, key)) {
    formattedFilters.push({
      [key]: searchLikeTypes.includes(fields[key].type) ? Like(`%${filters[key]}%`) : filters[key]
    })
  }
}
fork icon0
star icon3
watch icon21

+ 7 other calls in file

133
134
135
136
137
138
139
140
141
142
   * @returns {Promise<*>}
   */
  ${entityName}FindWhereLike: async (options) => {
    const searchKey = Object.keys(options)[0];
    const searchVal = Object.values(options)[0];
    options[searchKey] = Like(\`%\${searchVal}%\`);
    return await dataSource.getRepository('${entityName}').findBy(options);
  },
  
`;
fork icon0
star icon0
watch icon0