/campaigns: fast filter by ?byEarner
Ivshti opened this issue · 2 comments
Ivshti commented
query parameter that returns campaigns where there's a certain earner
do that by doing something like (not sure if correct) ```
{ [status.lastApprovedBalances.${req.params.earner}
]: {$exists: true} }
this is required here: https://github.com/AdExNetwork/adex-relayer/blob/master/routineAuthsLoop.js#L42
this is basically the same as #17 but I'm reopening it cause the previous implementation appears to be querying everything that has `balances` and filtering it server side; we want to filter it on a DB query level, for performance
Ivshti commented
it appears to work that way: https://github.com/AdExNetwork/adex-market/blob/master/routes/campaigns.js#L33
Ivshti commented
There's no ?byEarner now, again