You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the query param used by agenda's jobs() method does not support mongodb operators like $lte, $gte, etc. As an example, I am looking to be able to query for jobs that have been started in the last 5 minutes. Right now I only see 2 possible ways of accomplishing this:
Get all the jobs using agenda.jobs() and then filter the results. I definitely have performance concerns with this approach as the collection grows.
Wire my application directly up to the jobs collection (define a typegoose model, create a respository class, etc) and bypass agenda altogether in order to fetch this data. This would work, but it feels gross and wrong to talk directly to the collection for this one instance while using agenda for all other interactions with jobs.
Does anyone have thoughts on how to accomplish this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It appears that the
query
param used by agenda'sjobs()
method does not support mongodb operators like$lte
,$gte
, etc. As an example, I am looking to be able to query for jobs that have been started in the last 5 minutes. Right now I only see 2 possible ways of accomplishing this:agenda.jobs()
and then filter the results. I definitely have performance concerns with this approach as the collection grows.Does anyone have thoughts on how to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions