Skip to content
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

MONGOID-4834 Capped collection documentation examples lack setup/context #5337

Merged
merged 1 commit into from Jun 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/reference/collection-configuration.txt
Expand Up @@ -18,11 +18,20 @@ Mongoid does not provide a mechanism for creating capped collections on the fly
will need to create these yourself one time up front either with the driver or via the
Mongo console.

To create a capped collection with the driver:
To create a capped collection with the driver, first retrieve the client:

.. code-block:: ruby

client["name", :capped => true, :size => 1024].create
class Name
include Mongoid::Document
end
client = Name.collection.client

Then create the collection:

.. code-block:: ruby

client["names", :capped => true, :size => 1024].create

To create a capped collection from the Mongo console:

Expand Down