Skip to content

Don't suggest using a collection name with a dot #1688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/tutorial/expire-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down