I have a problem with typeorm where like. Here is my query:
await this.userRepository.createQueryBuilder('user')
.select('user.name, user.email, user.creationDate)
.where("user.name like :name", {name: '%' + match + '%' })
.getMany();
When i print getQueryAndParameters()
I see this:
[ 'SELECT `user`.`name`, `user`.`email`, `user`.`creationDate` FROM `user` `user`
WHERE `user`.`name` like ?', [ '%a%' ] ]
Where could it be a problem?
try this
.select('user.name')
.where("user.name ilike :name", { name: '%' + searchTerm + '%' })
ilike is case insensitive.