Open Nainabbas opened 5 years ago
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
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}.*`) } })
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