@@ -11,6 +11,16 @@ Queues
1111.. meta::
1212 :keywords: php framework, odm, code example, jobs
1313
14+ Overview
15+ --------
16+ 17+ In this guide, you can learn how to use MongoDB as your database for
18+ Laravel Queue. Laravel Queue allows you to create queued jobs that are
19+ processed in the background.
20+ 21+ Configuration
22+ -------------
23+ 1424To use MongoDB as your database for Laravel Queue, change
1525the driver in your application's ``config/queue.php`` file:
1626
@@ -22,7 +32,7 @@ the driver in your application's ``config/queue.php`` file:
2232 // You can also specify your jobs-specific database
2333 // in the config/database.php file
2434 'connection' => 'mongodb',
25- 'collection ' => 'jobs',
35+ 'table ' => 'jobs',
2636 'queue' => 'default',
2737 // Optional setting
2838 // 'retry_after' => 60,
@@ -48,7 +58,7 @@ the behavior of the queue:
4858 ``mongodb`` connection. The driver uses the default connection if
4959 a connection is not specified.
5060
51- * - ``collection ``
61+ * - ``table ``
5262 - **Required** Name of the MongoDB collection to
5363 store jobs to process.
5464
@@ -60,7 +70,7 @@ the behavior of the queue:
6070 before retrying a job that is being processed. The value is
6171 ``60`` by default.
6272
63- To use MongoDB to handle failed jobs, create a ``failed`` entry in your
73+ To use MongoDB to handle * failed jobs* , create a ``failed`` entry in your
6474application's ``config/queue.php`` file and specify the database and
6575collection:
6676
@@ -69,7 +79,7 @@ collection:
6979 'failed' => [
7080 'driver' => 'mongodb',
7181 'database' => 'mongodb',
72- 'collection ' => 'failed_jobs',
82+ 'table ' => 'failed_jobs',
7383 ],
7484
7585The following table describes properties that you can specify to configure
@@ -91,16 +101,13 @@ how to handle failed jobs:
91101 a ``mongodb`` connection. The driver uses the default connection
92102 if a connection is not specified.
93103
94- * - ``collection ``
104+ * - ``table ``
95105 - Name of the MongoDB collection to store failed
96106 jobs. The value is ``failed_jobs`` by default.
97107
98- Then, add the service provider in your application's
99- ``config/app.php`` file:
100- 101- .. code-block:: php
102- 103- MongoDB\Laravel\MongoDBQueueServiceProvider::class,
108+ The {+odm-short+} automatically provides the
109+ ``MongoDB\Laravel\MongoDBQueueServiceProvider::class`` class as the
110+ service provider to handle failed jobs.
104111
105112Job Batching
106113------------
@@ -124,7 +131,7 @@ application's ``config/queue.php`` file:
124131 'batching' => [
125132 'driver' => 'mongodb',
126133 'database' => 'mongodb',
127- 'collection ' => 'job_batches',
134+ 'table ' => 'job_batches',
128135 ],
129136
130137The following table describes properties that you can specify to configure
@@ -146,13 +153,13 @@ job batching:
146153 ``mongodb`` connection. The driver uses the default connection if
147154 a connection is not specified.
148155
149- * - ``collection ``
156+ * - ``table ``
150157 - Name of the MongoDB collection to store job
151158 batches. The value is ``job_batches`` by default.
152159
153160Then, add the service provider in your application's ``config/app.php``
154161file:
155162
156- .. code-block:: php
157- 158- MongoDB\Laravel\MongoDBBusServiceProvider::class,
163+ The {+odm-short+} automatically provides the
164+ ``MongoDB\Laravel\MongoDBBusServiceProvider::class`` class as the
165+ service provider for job batching.
0 commit comments