Skip to content

Commit

Permalink
add information about adding an index to improve garbage collection p…
Browse files Browse the repository at this point in the history
…erformance
  • Loading branch information
stevenmusumeche committed Jul 5, 2015
1 parent dde0ee1 commit 2faa2ac
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cookbook/configuration/mongodb_session_storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ Setting Up the MongoDB Collection
---------------------------------

Because MongoDB uses dynamic collection schemas, you do not need to do anything to initialize your
session collection.
session collection. However, you may want to add an index to improve garbage collection performance.
From the `MongoDB shell`_:

.. _installed and configured a MongoDB server: http://docs.mongodb.org/manual/installation/
.. code-block:: sql
use session_db
db.session.ensureIndex( { "expireAt": 1 }, { expireAfterSeconds: 0 } )
.. _installed and configured a MongoDB server: http://docs.mongodb.org/manual/installation/
.. _MongoDB shell: http://docs.mongodb.org/v2.2/tutorial/getting-started-with-the-mongo-shell/

0 comments on commit 2faa2ac

Please sign in to comment.