We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4674f42 commit e0d3de9Copy full SHA for e0d3de9
docs/reference/collection-configuration.txt
@@ -18,11 +18,20 @@ Mongoid does not provide a mechanism for creating capped collections on the fly
18
will need to create these yourself one time up front either with the driver or via the
19
Mongo console.
20
21
-To create a capped collection with the driver:
+To create a capped collection with the driver, first retrieve the client:
22
23
.. code-block:: ruby
24
25
- client["name", :capped => true, :size => 1024].create
+ class Name
26
+ include Mongoid::Document
27
+ end
28
+ client = Name.collection.client
29
+
30
+Then create the collection:
31
32
+.. code-block:: ruby
33
34
+ client["names", :capped => true, :size => 1024].create
35
36
To create a capped collection from the Mongo console:
37
0 commit comments