'How can I use Logical operators (AND, OR, NOT) in adonis js using mysql?
I want to get data from the database on multiple conditions but I did not find any solution on how to apply logical operators. Need your help. Here is my query in A
const nftRarityInfo = await Database.query().select('rarity').from('rarity_info').where('id','=', detailData[0].rarity_id AND "is_active", "=",'1')
Solution 1:[1]
Finally I got solution by myself. Following query works perfect for me:
const nftRarityInfo = await Database.query().select('rarity').from('rarity_info').where('id','=', detailData[0].rarity_id ).andWhere('is_active','=','1')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Abdul Sammad |
