@@ -30,6 +30,24 @@ namespace options {
3030// /
3131class MONGOCXX_API create_collection {
3232 public:
33+ // /
34+ // / Specify false to disable the automatic creation of an index on the _id field.
35+ // /
36+ // / @note For replica sets, all collections must have autoIndexId set to true.
37+ // /
38+ // / @param auto_index_id
39+ // / Whether or not this collection will automatically generate an index on _id.
40+ // /
41+ create_collection& auto_index_id (bool auto_index_id);
42+
43+ // /
44+ // / Gets the current auto_index_id setting.
45+ // /
46+ // / @return
47+ // / Whether or not this collection will automatically generate an index on _id.
48+ // /
49+ const stdx::optional<bool >& auto_index_id () const ;
50+
3351 // /
3452 // / To create a capped collection, specify true.
3553 // /
@@ -53,43 +71,26 @@ class MONGOCXX_API create_collection {
5371 const stdx::optional<bool >& capped () const ;
5472
5573 // /
56- // / Specify false to disable the automatic creation of an index on the _id field .
74+ // / Sets the default collation for this collection .
5775 // /
58- // / @note For replica sets, all collections must have autoIndexId set to true.
76+ // / @param collation
77+ // / The default collation for the collection.
5978 // /
60- // / @param auto_index_id
61- // / Whether or not this collection will automatically generate an index on _id.
79+ // / @see
80+ // / https://docs.mongodb.com/master/reference/collation/
6281 // /
63- create_collection& auto_index_id ( bool auto_index_id );
82+ create_collection& collation (bsoncxx::document::view_or_value collation );
6483
6584 // /
66- // / Gets the current auto_index_id setting .
85+ // / Gets the default collation for this collection .
6786 // /
6887 // / @return
69- // / Whether or not this collection will automatically generate an index on _id.
70- // /
71- const stdx::optional<bool >& auto_index_id () const ;
72-
73- // /
74- // / A maximum size, in bytes, for a capped collection.
75- // /
76- // / @note Once a capped collection reaches its maximum size, MongoDB removes older
77- // / documents to make space for new documents.
78- // /
79- // / @note Size is required for capped collections and ignored for other collections.
80- // /
81- // / @param max_size
82- // / Maximum size, in bytes, of this collection (if capped).
83- // /
84- create_collection& size (int max_size);
85-
86- // /
87- // / Gets the current size setting, for a capped collection.
88+ // / The default collation for the collection.
8889 // /
89- // / @return
90- // / Maximum size, in bytes, of this collection (if capped).
90+ // / @see
91+ // / https://docs.mongodb.com/master/reference/collation/
9192 // /
92- const stdx::optional<int >& size () const ;
93+ const stdx::optional<bsoncxx::document::view_or_value >& collation () const ;
9394
9495 // /
9596 // / The maximum number of documents allowed in the capped collection.
@@ -113,64 +114,63 @@ class MONGOCXX_API create_collection {
113114 const stdx::optional<int >& max () const ;
114115
115116 // /
116- // / Sets the default collation for this collection.
117+ // / When true, disables the power of 2 sizes allocation for the collection.
117118 // /
118- // / @param collation
119- // / The default collation for the collection.
119+ // / @see https://docs.mongodb.org/manual/reference/method/db.createCollection/
120120 // /
121- // / @see
122- // / https://docs.mongodb.com/master/reference/collation/
121+ // / @param no_padding
122+ // / When true, disables power of 2 sizing for this collection.
123123 // /
124- create_collection& collation (bsoncxx::document::view_or_value collation );
124+ create_collection& no_padding ( bool no_padding );
125125
126126 // /
127- // / Gets the default collation for this collection.
127+ // / Gets the current value of the "no padding" option for the collection.
128128 // /
129- // / @return
130- // / The default collation for the collection.
129+ // / @see https://docs.mongodb.org/manual/reference/method/db.createCollection/
131130 // /
132- // / @see
133- // / https://docs.mongodb.com/master/reference/collation/
131+ // / @return
132+ // / When true, power of 2 sizing is disabled for this collection.
134133 // /
135- const stdx::optional<bsoncxx::document::view_or_value >& collation () const ;
134+ const stdx::optional<bool >& no_padding () const ;
136135
137136 // /
138- // / Specify configuration to the storage on a per-collection basis .
137+ // / A maximum size, in bytes, for a capped collection .
139138 // /
140- // / @note This option is currently only available with the WiredTiger storage engine.
139+ // / @note Once a capped collection reaches its maximum size, MongoDB removes older
140+ // / documents to make space for new documents.
141141 // /
142- // / @param storage_engine_options
143- // / Configuration options specific to the storage engine.
142+ // / @note Size is required for capped collections and ignored for other collections.
144143 // /
145- create_collection& storage_engine (bsoncxx::document::view_or_value storage_engine_opts);
144+ // / @param max_size
145+ // / Maximum size, in bytes, of this collection (if capped).
146+ // /
147+ create_collection& size (int max_size);
146148
147149 // /
148- // / Gets the current storage engine configuration for this collection.
150+ // / Gets the current size setting, for a capped collection.
149151 // /
150152 // / @return
151- // / Configuration options specific to the storage engine .
153+ // / Maximum size, in bytes, of this collection (if capped) .
152154 // /
153- const stdx::optional<bsoncxx::document::view_or_value >& storage_engine () const ;
155+ const stdx::optional<int >& size () const ;
154156
155157 // /
156- // / When true, disables the power of 2 sizes allocation for the collection.
158+ // / Specify configuration to the storage on a per- collection basis .
157159 // /
158- // / @see https://docs.mongodb.org/manual/reference/method/db.createCollection/
160+ // / @note This option is currently only available with the WiredTiger storage engine.
159161 // /
160- // / @param no_padding
161- // / When true, disables power of 2 sizing for this collection .
162+ // / @param storage_engine_options
163+ // / Configuration options specific to the storage engine .
162164 // /
163- create_collection& no_padding ( bool no_padding );
165+ create_collection& storage_engine (bsoncxx::document::view_or_value storage_engine_opts );
164166
165167 // /
166- // / Gets the current value of the "no padding" option for the collection.
167- // /
168- // / @see https://docs.mongodb.org/manual/reference/method/db.createCollection/
168+ // / Gets the current storage engine configuration for this collection.
169169 // /
170170 // / @return
171- // / When true, power of 2 sizing is disabled for this collection .
171+ // / Configuration options specific to the storage engine .
172172 // /
173- const stdx::optional<bool >& no_padding () const ;
173+ const stdx::optional<bsoncxx::document::view_or_value >& storage_engine () const ;
174174
175175 // /
176176 // / Specify validation criteria for this collection.
@@ -211,13 +211,13 @@ class MONGOCXX_API create_collection {
211211 MONGOCXX_INLINE operator bsoncxx::document::value () const ;
212212
213213 private:
214- stdx::optional<bool > _capped;
215214 stdx::optional<bool > _auto_index_id;
216- stdx::optional<int > _max_size;
217- stdx::optional<int > _max_documents;
215+ stdx::optional<bool > _capped;
218216 stdx::optional<bsoncxx::document::view_or_value> _collation;
219- stdx::optional<bsoncxx::document::view_or_value> _storage_engine_opts;
217+ stdx::optional<int > _max_documents;
218+ stdx::optional<int > _max_size;
220219 stdx::optional<bool > _no_padding;
220+ stdx::optional<bsoncxx::document::view_or_value> _storage_engine_opts;
221221 stdx::optional<class validation_criteria > _validation;
222222};
223223
0 commit comments