Use the .where() method to filter cards or sets based on specific property values.
Note: For sets, you can currently only query using the name and block fields.
// Querying cards by supertypes and subtypes
const cardResult = await mtg.card.where({ supertypes: 'legendary', subtypes: 'goblin' })
console.log(cardResult.cards[0].name) // e.g., "Squee, Goblin Nabob"
// Querying sets by block and border
const setResult = await mtg.set.where({ block: 'Shadows over Innistrad', border: 'black' })
console.log(setResult.sets[0].name)
const result = await card.where({ supertypes: 'legendary', subtypes: 'goblin' })
console.log(cards[0].name) // "Squee, Goblin Nabob"
const result = await set.where({ block: 'Shadows over Innistrad', border: 'black' })
console.log(sets[0].name) // "Welcome Deck 2016"
console.log(sets[1].name) // "Shadows over Innistrad"
console.log(sets[2].name) // "Eldritch Moon"