Skip to content

Queue.findJob

Grant Carthew edited this page Sep 29, 2016 · 11 revisions

Method Signature

Queue.findJob(predicate)

Parameter: predicate Object or Function

  • predicate can be a simple object or a complex function.

Returns: Array

  • If your predicate is successful, an Array of Job objects will be returned. If not and empty Array is returned.

Example:

q.findJob({ email: '[email protected]' }).then((jobs) => {
  // jobs will either be an empty array
  // or an array of Job objects that have an
  // email property equal to '[email protected]'
}).catch(err => console.error(err))

Description

One of the most flexible methods on the Queue objects is the Queue.findJob. This method exposes the full and rich filter functionality of the RethinkDB database.

Using the Queue.findJob method you can extract information about the jobs in the queue. Here is a quick list of information you could obtain using Queue.findJob.

  • Confirm a job has not already been added to the queue (ensure unique job).
  • Get all jobs related to a common task.
  • Get all failed or terminated jobs.
  • Produce reports on any job data.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally