From f5291de5a26b357deade731dc55f56a64e55f5cd Mon Sep 17 00:00:00 2001 From: Gianfranco Palumbo Date: Fri, 28 Mar 2014 11:44:28 -0400 Subject: [PATCH] Don't suggest using a collection name with a dot --- source/tutorial/expire-data.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/tutorial/expire-data.txt b/source/tutorial/expire-data.txt index 836695ec97a..775cfffd4ae 100644 --- a/source/tutorial/expire-data.txt +++ b/source/tutorial/expire-data.txt @@ -106,26 +106,26 @@ seconds in the ``expireAfterSeconds`` field has passed since the time specified in its indexed field. [#field-is-array-of-dates]_ For example, the following operation creates an index on the -``log.events`` collection's ``createdAt`` field and specifies the +``log_events`` collection's ``createdAt`` field and specifies the ``expireAfterSeconds`` value of ``3600`` to set the expiration time to be one hour after the time specified by ``createdAt``. .. code-block:: javascript - db.log.events.ensureIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 } ) + db.log_events.ensureIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 } ) -When adding documents to the ``log.events`` collection, set the +When adding documents to the ``log_events`` collection, set the ``createdAt`` field to the current time: .. code-block:: javascript - db.log.events.insert( { + db.log_events.insert( { "createdAt": new Date(), "logEvent": 2, "logMessage": "Success!" } ) -MongoDB will automatically delete documents from the ``log.events`` +MongoDB will automatically delete documents from the ``log_events`` collection when the document's ``createdAt`` value [#field-is-array-of-dates]_ is older than the number of seconds specified in ``expireAfterSeconds``.