Skip to content

Commit e5dba7a

Browse files
author
Joe Bennett
committed
#27345 Added public createTTLIndex method
1 parent 8ab6b63 commit e5dba7a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/lock.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ MongoDbStore
225225

226226
The MongoDbStore saves locks on a MongoDB server, it requires a ``\MongoDB\Client``
227227
connection from `mongodb/mongodb`_.
228-
This store does not support blocking, and expects a TTL to avoid stalled locks::
228+
This store does not support blocking and expects a TTL to avoid stalled locks::
229229

230230
use Symfony\Component\Lock\Store\MongoDbStore;
231231

@@ -480,7 +480,7 @@ For more details see: https://docs.mongodb.com/manual/reference/limits/#Index-Ke
480480

481481
A TTL index MUST BE used on MongoDB 2.2+ to automatically clean up expired locks.
482482

483-
Such an index can for example look like this:
483+
Such an index can be created manually:
484484

485485
.. code-block:: javascript
486486
@@ -489,6 +489,9 @@ Such an index can for example look like this:
489489
{ "expireAfterSeconds": 0 }
490490
)
491491
492+
Alternatively, the method ``MongoDbStore::createTTLIndex()`` can be called once
493+
to create the TTL index during setup.
494+
492495
For more details see: http://docs.mongodb.org/manual/tutorial/expire-data/
493496

494497
writeConcern, readConcern and readPreference are not specified by MongoDbStore

0 commit comments

Comments
 (0)