Reputation: 23
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')
Upvotes: 0
Views: 534
Reputation: 23
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')
Upvotes: 1