Okay, maybe I'm just not using my imagination here, but I can't figure this one out.
Suppose I have a dataset like this:
this.combos = [
{ phase: 1, moves: [ 'electrocute', 'heal' ], rating: 1 },
{ phase: 1, moves: [ 'hellfire', 'windchill' ], rating: 2 },
{ phase: 1, moves: [ 'windchill', 'hellfire' ], rating: 2 },
{ phase: 2, weaponID: 'powerBow', moves: [ 'flareShot', 'chillShot' ], rating: 2 },
// ...and so on
];
And I want to take a number of random items from that array such that:
- All results have .phase <= bossPhase
- No more than one result contains a weaponID
Is there a way I can construct a single query the meets both criteria?