@@ -47,14 +47,6 @@ final class CreateCollection
47
47
*
48
48
* Supported options:
49
49
*
50
- * * autoIndexId (boolean): Specify false to disable the automatic creation
51
- * of an index on the _id field. For replica sets, this option cannot be
52
- * false. The default is true.
53
- *
54
- * This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0,
55
- * this option cannot be false when creating a replicated collection
56
- * (i.e. a collection outside of the local database in any mongod mode).
57
- *
58
50
* * capped (boolean): Specify true to create a capped collection. If set,
59
51
* the size option must also be specified. The default is false.
60
52
*
@@ -123,10 +115,6 @@ final class CreateCollection
123
115
*/
124
116
public function __construct (private string $ databaseName , private string $ collectionName , private array $ options = [])
125
117
{
126
- if (isset ($ this ->options ['autoIndexId ' ]) && ! is_bool ($ this ->options ['autoIndexId ' ])) {
127
- throw InvalidArgumentException::invalidType ('"autoIndexId" option ' , $ this ->options ['autoIndexId ' ], 'boolean ' );
128
- }
129
-
130
118
if (isset ($ this ->options ['capped ' ]) && ! is_bool ($ this ->options ['capped ' ])) {
131
119
throw InvalidArgumentException::invalidType ('"capped" option ' , $ this ->options ['capped ' ], 'boolean ' );
132
120
}
@@ -207,10 +195,6 @@ public function __construct(private string $databaseName, private string $collec
207
195
unset($ this ->options ['writeConcern ' ]);
208
196
}
209
197
210
- if (isset ($ this ->options ['autoIndexId ' ])) {
211
- trigger_error ('The "autoIndexId" option is deprecated and will be removed in version 2.0 ' , E_USER_DEPRECATED );
212
- }
213
-
214
198
if (isset ($ this ->options ['pipeline ' ]) && ! is_pipeline ($ this ->options ['pipeline ' ], true /* allowEmpty */ )) {
215
199
throw new InvalidArgumentException ('"pipeline" option is not a valid aggregation pipeline ' );
216
200
}
@@ -233,7 +217,7 @@ private function createCommand(): Command
233
217
{
234
218
$ cmd = ['create ' => $ this ->collectionName ];
235
219
236
- foreach (['autoIndexId ' , ' capped ' , 'comment ' , 'expireAfterSeconds ' , 'max ' , 'maxTimeMS ' , 'pipeline ' , 'size ' , 'validationAction ' , 'validationLevel ' , 'viewOn ' ] as $ option ) {
220
+ foreach (['capped ' , 'comment ' , 'expireAfterSeconds ' , 'max ' , 'maxTimeMS ' , 'pipeline ' , 'size ' , 'validationAction ' , 'validationLevel ' , 'viewOn ' ] as $ option ) {
237
221
if (isset ($ this ->options [$ option ])) {
238
222
$ cmd [$ option ] = $ this ->options [$ option ];
239
223
}
0 commit comments