@@ -11,6 +11,16 @@ Queues
11
11
.. meta::
12
12
:keywords: php framework, odm, code example, jobs
13
13
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
+
14
24
To use MongoDB as your database for Laravel Queue, change
15
25
the driver in your application's ``config/queue.php`` file:
16
26
@@ -22,7 +32,7 @@ the driver in your application's ``config/queue.php`` file:
22
32
// You can also specify your jobs-specific database
23
33
// in the config/database.php file
24
34
'connection' => 'mongodb',
25
- 'collection ' => 'jobs',
35
+ 'table ' => 'jobs',
26
36
'queue' => 'default',
27
37
// Optional setting
28
38
// 'retry_after' => 60,
@@ -48,7 +58,7 @@ the behavior of the queue:
48
58
``mongodb`` connection. The driver uses the default connection if
49
59
a connection is not specified.
50
60
51
- * - ``collection ``
61
+ * - ``table ``
52
62
- **Required** Name of the MongoDB collection to
53
63
store jobs to process.
54
64
@@ -60,7 +70,7 @@ the behavior of the queue:
60
70
before retrying a job that is being processed. The value is
61
71
``60`` by default.
62
72
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
64
74
application's ``config/queue.php`` file and specify the database and
65
75
collection:
66
76
@@ -69,7 +79,7 @@ collection:
69
79
'failed' => [
70
80
'driver' => 'mongodb',
71
81
'database' => 'mongodb',
72
- 'collection ' => 'failed_jobs',
82
+ 'table ' => 'failed_jobs',
73
83
],
74
84
75
85
The following table describes properties that you can specify to configure
@@ -91,16 +101,13 @@ how to handle failed jobs:
91
101
a ``mongodb`` connection. The driver uses the default connection
92
102
if a connection is not specified.
93
103
94
- * - ``collection ``
104
+ * - ``table ``
95
105
- Name of the MongoDB collection to store failed
96
106
jobs. The value is ``failed_jobs`` by default.
97
107
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.
104
111
105
112
Job Batching
106
113
------------
@@ -124,7 +131,7 @@ application's ``config/queue.php`` file:
124
131
'batching' => [
125
132
'driver' => 'mongodb',
126
133
'database' => 'mongodb',
127
- 'collection ' => 'job_batches',
134
+ 'table ' => 'job_batches',
128
135
],
129
136
130
137
The following table describes properties that you can specify to configure
@@ -146,13 +153,13 @@ job batching:
146
153
``mongodb`` connection. The driver uses the default connection if
147
154
a connection is not specified.
148
155
149
- * - ``collection ``
156
+ * - ``table ``
150
157
- Name of the MongoDB collection to store job
151
158
batches. The value is ``job_batches`` by default.
152
159
153
160
Then, add the service provider in your application's ``config/app.php``
154
161
file:
155
162
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