Error Method "$like" is not support by query builder
Nainabbas opened this issue · comments
I am trying to get user where name includes some substring using 'like' parameter. This error comes Method "$like" is not support by query builder
async test({ response }) { let users = await User.query() .where("fname", "like", "%nain%") .fetch(); return response.send(users); }
try with regex
await User.where({ name: { $regex: new RegExp(`.*${name}.*`) } })