Cancel
pulse.cancel(query)
pulse.cancel(query)
The cancel
method is designed to cancel and permanently remove jobs from the MongoDB database that match a specified query. This functionality is critical for managing job lifecycles, particularly when certain jobs are no longer needed or conditions change requiring their termination.
Example Usage
Parameters
query
(Filter<Document>
): A MongoDB query that specifies which jobs to cancel and delete. This query should conform to MongoDB's query standards and can include various criteria to match specific jobs.
Returns
Promise<number | undefined>
: Returns a promise that resolves with the number of jobs deleted from the database. If no jobs are found that match the query, the promise may resolve toundefined
or0
.
Last updated