diff --git a/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index b8b63931650bc4951addacdb89d70c41be307c66..33b1bae30264c0c1a0ed278ec63e68165ecba9e8 100644 --- a/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -4,9 +4,8 @@ type: array description: | Default :php:`type map <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to cursors. The type map determines how BSON documents are converted - to PHP values which determines. The |php-library| uses the following type map - by default: + to apply to cursors, which determines how BSON documents are converted to PHP + values. The |php-library| uses the following type map by default: .. code-block:: php @@ -16,7 +15,6 @@ description: | 'root' => 'MongoDB\Model\BSONDocument', ] interface: phpmethod -operation: MongoDB\\Client::__construct +operation: ~ optional: true -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml b/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml index 2365d44f7f14ac95411ad436495f3625406ab7e6..03f2d5722e2c5fe2d70a875c95103066f04ae4e1 100644 --- a/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml @@ -6,11 +6,10 @@ description: | connect. Refer to the :manual:`MongoDB connection string reference </reference/connection-string>` for formatting. - Defaults to ``mongodb://127.0.0.1:27017`` if unspecified. + Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified. interface: phpmethod -operation: MongoDB\\Client::__construct +operation: ~ optional: true -position: 1 --- arg_name: param name: $uriOptions @@ -19,15 +18,14 @@ description: | Specifies additional URI options, such as authentication credentials or query string parameters. The options specified in ``$uriOptions`` take precedence over any analogous options present in the ``$uri`` string. -post: | + Refer to the :php:`MongoDB\\Driver\\Manager::__construct() <mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB - connection string </reference/connection-string>` documentation for valid + connection string </reference/connection-string>` documentation for accepted options. interface: phpmethod -operation: MongoDB\\Client::__construct +operation: ~ optional: true -position: 2 --- arg_name: param name: $driverOptions @@ -39,7 +37,6 @@ description: | <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` to apply to the cursors it creates. interface: phpmethod -operation: MongoDB\\Client::__construct +operation: ~ optional: true -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml index de0ceb56d49f6c990cd32e45998be8c2b4a8cec8..22141f1ad881c3f65432373c33f9e247cad86702 100644 --- a/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml @@ -1,8 +1,19 @@ source: file: apiargs-common-option.yaml ref: typeMap -operation: MongoDB\\Client::dropDatabase +post: | + This will be used for the returned command result document. +--- +arg_name: option +name: writeConcern +type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` description: | - Type map for BSON deserialization. This will be used for the returned command - result document. Defaults to the clients's type map. + :manual:`Write concern </reference/write-concern>` to use for the operation. + Defaults to the client's write concern. + + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. +interface: phpmethod +operation: ~ +optional: true ... diff --git a/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml index c0cf8e3499238d46a3373ddfc12f8798dfb1604c..07b768348cff273fb9074f97473b9d92494014d2 100644 --- a/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml @@ -1,14 +1,10 @@ source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Client::dropDatabase -position: 1 replacement: action: " to drop" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Client::dropDatabase -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBClient-method-get-param.yaml b/docs/includes/apiargs-MongoDBClient-method-get-param.yaml index 7a228e41eda1b6bad08b32434306eafe7fcc519c..e9d3ccc6c1c263e95c3d7cbcd8d911f2985eb739 100644 --- a/docs/includes/apiargs-MongoDBClient-method-get-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-get-param.yaml @@ -1,8 +1,6 @@ source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Client::__get -position: 1 replacement: action: " to select" ... diff --git a/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index 0ca09184705b49908f0c57c9efa22975ea106831..4eb407fe740311bc89466ff18cc19b7f385c885a 100644 --- a/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -1,5 +1,4 @@ source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Client::listDatabases ... diff --git a/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml index 3297e349d81dc90837d4f6cd77c2d0d5beebfc7c..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Client::listDatabases -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml index a2cfa687be5d95fe1d0dc2f656c91a69ebf24647..99c764460536d2337e86c3ca8dd4e691e5707722 100644 --- a/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml @@ -1,22 +1,16 @@ source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Client::selectCollection -position: 1 replacement: action: " containing the collection to select" --- source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Client::selectCollection -position: 2 replacement: action: " to select" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Client::selectCollection -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml index 2432ca4d5646628408df4a2eb05c8e70f5f2c8d1..8e5f9d45f73876333e3aa158271050aee2928680 100644 --- a/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml +++ b/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml @@ -1,14 +1,10 @@ source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Client::selectDatabase -position: 1 replacement: action: " to select" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Client::selectDatabase -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-common-option.yaml b/docs/includes/apiargs-MongoDBCollection-common-option.yaml new file mode 100644 index 0000000000000000000000000000000000000000..559c138b358c8d5381569f4780634ab6344f3c45 --- /dev/null +++ b/docs/includes/apiargs-MongoDBCollection-common-option.yaml @@ -0,0 +1,79 @@ +arg_name: option +name: bypassDocumentValidation +type: boolean +description: | + If ``true``, allows the write operation to circumvent document level + validation. Defaults to ``false``. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: collation +type: array|object +description: | + :manual:`Collation </reference/collation>` allows users to specify + language-specific rules for string comparison, such as rules for lettercase + and accent marks. When specifying collation, the ``locale`` field is + mandatory; all other collation fields are optional. For descriptions of the + fields, see :manual:`Collation Document + <reference/collation/#collation-document>`. + + If the collation is unspecified but the collection has a default collation, + the operation uses the collation specified for the collection. If no + collation is specified for the collection or for the operation, MongoDB uses + the simple binary comparison used in prior versions for string comparisons. + + This option is available in MongoDB 3.4+ and will result in an exception at + execution time if specified for an older server version. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: readConcern +type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>` +description: | + :manual:`Read concern </reference/read-concern>` to use for the operation. + Defaults to the collection's read concern. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: readPreference +type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>` +description: | + :manual:`Read preference </reference/read-preference>` to use for the + operation. Defaults to the collection's read preference. +interface: phpmethod +operation: ~ +optional: true +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +replacement: + parent: "collection" +--- +arg_name: option +name: writeConcern +type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` +description: | + :manual:`Write concern </reference/write-concern>` to use for the operation. + Defaults to the collection's write concern. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: upsert +type: boolean +description: | + If set to ``true``, creates a new document when no document matches the query + criteria. The default value is ``false``, which does not insert a new + document when no match is found. +interface: phpmethod +operation: ~ +optional: true +... diff --git a/docs/includes/apiargs-MongoDBCollection-common-param.yaml b/docs/includes/apiargs-MongoDBCollection-common-param.yaml new file mode 100644 index 0000000000000000000000000000000000000000..73c18fa468aa6169bd3c61e16dcaaa698d23cdc7 --- /dev/null +++ b/docs/includes/apiargs-MongoDBCollection-common-param.yaml @@ -0,0 +1,31 @@ +arg_name: param +name: $filter +type: array|object +description: | + The filter criteria that specifies the documents{{action}}. +interface: phpmethod +operation: ~ +optional: false +replacement: + action: "" +--- +arg_name: param +name: $replacement +type: array|object +description: | + The replacement document. +interface: phpmethod +operation: ~ +optional: false +--- +arg_name: param +name: $update +type: array|object +description: | + Specifies the field and value combinations to update and any relevant update + operators. ``$update`` uses MongoDB's :method:`update operators + </reference/operator/update>`. +interface: phpmethod +operation: ~ +optional: false +... diff --git a/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index 38f00c4cae3bf1428cdacf79f54254221fcf5ee6..0d440197ff010d98293b3409bead4e428062a338 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -3,68 +3,59 @@ name: allowDiskUse type: boolean description: | Enables writing to temporary files. When set to ``true``, aggregation stages - can write data to the ``_tmp`` sub-directory in the dbPath directory. - The default is ``false``. + can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The + default is ``false``. interface: phpmethod -operation: MongoDB\\Collection::aggregate +operation: ~ optional: true -position: 1 --- arg_name: option name: batchSize type: integer description: | - The number of documents to return per batch + Specifies the initial batch size for the cursor. A batchSize of ``0`` means an + empty first batch and is useful for quickly returning a cursor or failure + message without doing significant server-side work. + + .. note:: + + This is not supported for inline aggregation results (i.e. ``useCursor`` + option is ``false`` or the server version is < 2.6). interface: phpmethod -operation: MongoDB\\Collection::aggregate +operation: ~ optional: true -position: 2 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::aggregate -position: 3 +post: | + This only applies when using the :pipeline:`$out` stage. + + Document validation requires MongoDB 3.2 or later: if you are using an earlier + version of MongoDB, this option will be ignored. --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::aggregate -position: 4 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readConcern -operation: MongoDB\\Collection::aggregate -position: 5 -replacement: - resource: "aggregation" - parent: "collection" --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference -operation: MongoDB\\Collection::aggregate -position: 6 -replacement: - resource: "aggregation" - parent: "collection" --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::aggregate -position: 7 -description: | - Type map for BSON deserialization. This will be applied to the returned - cursor. Defaults to the collections's type map. - +post: | .. note:: This is not supported for inline aggregation results (i.e. ``useCursor`` option is ``false`` or the server version is < 2.6). --- -arg_name: param +arg_name: option name: useCursor type: boolean description: | @@ -77,7 +68,15 @@ description: | ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation cursors are not available. interface: phpmethod -operation: MongoDB\\Collection::aggregate +operation: ~ optional: true -position: 8 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This only applies when the ``$out`` stage is specified. + + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml index 65433abb78848fcda0505d7e9e9169c2c03b1669..cbad3b49b0c834d8d496b649cdddcf379b2aa6e9 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml @@ -5,12 +5,10 @@ description: | Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>` operation. interface: phpmethod -operation: MongoDB\\Collection::aggregate -position: 1 +operation: ~ +optional: false --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::aggregate -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml index afc90708962c6bc7d906205baa862c21b56101c4..680769cf9779b8f57753285c558ca1c4487d13ea 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml @@ -1,8 +1,6 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::bulkWrite -position: 1 --- arg_name: option name: ordered @@ -16,16 +14,10 @@ description: | The default is ``true``. interface: phpmethod -operation: MongoDB\\Collection::bulkWrite +operation: ~ optional: true -position: 2 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::bulkWrite -replacement: - resource: "write" - parent: "collection" -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml index 7f115862b8ee3a232f9757fd5dcd98d35e7c18d0..79423a63778a6090f5f9b4d5cf1621c52ab05552 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml @@ -22,20 +22,16 @@ description: | [ 'updateMany' => [ $filter, $update, $options ] ], [ 'updateOne' => [ $filter, $update, $options ] ], ] -post: | + Arguments correspond to the respective operation methods. However, the ``writeConcern`` option is specified as a top-level option to :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual operation. interface: phpmethod -operation: MongoDB\\Collection::bulkWrite +operation: ~ optional: true -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::bulkWrite -interface: phpmethod -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml index 006a71eba9889ab07af5845bb3afa92073fc3e7e..7d422ca05966330fd79f7eeb7cdad78a593f18bd 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml @@ -1,8 +1,6 @@ source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Collection::__construct -position: 1 replacement: resource: "collection" parent: "manager" @@ -10,39 +8,17 @@ replacement: source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Collection::__construct -position: 2 replacement: resource: "collection" parent: "manager" --- -arg_name: option -name: typeMap -type: array -description: | - Default :php:`type map - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to cursors. The type map determines how BSON documents are converted - to PHP values which determines. The |php-library| uses the following type map - by default: - - .. code-block:: php - - [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ] -interface: phpmethod -operation: MongoDB\\Collection::__construct -optional: true -position: 3 +source: + file: apiargs-MongoDBClient-method-construct-driverOptions.yaml + ref: typeMap --- source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::__construct -position: 4 replacement: resource: "collection" parent: "manager" diff --git a/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml index d72ed636f9143b2b552af94dde8ec57cdef1cca8..0827800baa720a08405d592aa1e8fd55466695a1 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml @@ -1,24 +1,16 @@ source: file: apiargs-common-param.yaml ref: $manager -operation: MongoDB\\Collection::__construct -position: 1 --- source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Collection::__construct -position: 2 --- source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Collection::__construct -position: 3 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::__construct -position: 4 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml index 098e9d2113853b52b6eb5f57f393154230cdfb10..a3598c593e0130713763878c9d86bebf5f9aa829 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml @@ -1,54 +1,44 @@ +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +--- arg_name: option name: hint type: string|array|object description: | The index to use. If you specify a document, it is interpreted as an index - specification and a name will be generated. + specification from which a name will be derived. interface: phpmethod -operation: MongoDB\\Collection::count +operation: ~ optional: true -position: 1 --- arg_name: option name: limit type: integer description: | - The maximum number of documents to return. + The maximum number of matching documents to return. interface: phpmethod -operation: MongoDB\\Collection::count +operation: ~ optional: true -position: 2 --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::count -position: 3 --- source: + file: apiargs-MongoDBCollection-common-option.yaml ref: readConcern - file: apiargs-common-option.yaml -operation: MongoDB\\Collection::count -replacement: - resource: "count" - parent: "collection" -position: 4 --- source: + file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference - file: apiargs-common-option.yaml -replacement: - resource: "count" - parent: "collection" -position: 5 --- arg_name: option name: skip type: integer description: | - The number of documents to skip before returning the documents. + The number of matching documents to skip before returning results. interface: phpmethod -operation: MongoDB\\Collection::count +operation: ~ optional: true -position: 6 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml index 75f281d827e473044b45a02d08534709980f8d40..e18c616bc01e4ff50282e7df219eae01221ac690 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml @@ -1,12 +1,11 @@ source: - file: apiargs-common-param.yaml + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter -operation: MongoDB\\Collection::count -position: 1 +optional: true +replacement: + action: " to count" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::count -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml index 65b38892e27254cb0726e87133f6bc0be5785648..a7364a660df826d6bd7ecf6c76263facf702ece3 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -4,9 +4,15 @@ type: boolean description: | Creates a :manual:`unique </core/index-unique>` index. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 1 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +pre: | + Specifies the :manual:`collation + </reference/bson-type-comparison-order/#collation>` for the index. --- arg_name: option name: partialFilterExpression @@ -14,9 +20,8 @@ type: array|object description: | Creates a :manual:`partial </core/index-partial>` index. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 2 --- arg_name: option name: sparse @@ -24,9 +29,8 @@ type: boolean description: | Creates a :manual:`sparse </core/index-sparse>` index. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 3 --- arg_name: option name: expireAfterSeconds @@ -34,20 +38,18 @@ type: integer description: | Creates a :manual:`TTL </core/index-ttl>` index. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 4 --- arg_name: option name: name type: string description: | - Specifies the name for the index. By default, MongoDB creates index names - based on the key. + A name that uniquely identifies the index. By default, MongoDB creates index + names based on the key. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 5 --- arg_name: option name: background @@ -56,9 +58,8 @@ description: | Instructs MongoDB to build the index :manual:`as a background </core/index-creation>` process. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 6 --- arg_name: option name: 2dsphereIndexVersion @@ -69,15 +70,15 @@ description: | MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default version of 2dsphere indexes created in MongoDB 2.6 and later versions. - ``2dsphereIndexVersion`` enables you to overrride the default version 2. + ``2dsphereIndexVersion`` enables you to override the default version 2. interface: phpmethod -operation: MongoDB\\Collection::createIndex +operation: ~ optional: true -position: 7 --- source: - ref: maxTimeMS - file: apiargs-common-option.yaml -operation: MongoDB\\Collection::createIndex -position: 8 + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml index 5d1d0deb800e052130cf85924b665febdf377ffe..c2979d913c6d0ce4709f5c73a601b9e42671f280 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml @@ -10,14 +10,11 @@ description: | .. code-block:: php [ 'username' => -1 ] -operation: MongoDB\\Collection::createIndex interface: phpmethod +operation: ~ optional: false -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::createIndex -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2be24cbabc06a53c70f73893cf09ad69a0d4912f --- /dev/null +++ b/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml @@ -0,0 +1,7 @@ +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. +... diff --git a/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e98d9aad0283f2f464ec276a946055215187ca58 --- /dev/null +++ b/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml @@ -0,0 +1,23 @@ +arg_name: param +name: $indexes +type: array +description: | + The indexes to create on the collection. + + For example, the following specifies a unique index on the ``username`` field + and a compound index on the ``email`` and ``createdAt`` fields: + + .. code-block:: php + + [ + [ 'key' => [ 'username' => -1 ], 'unique' => true ], + [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ], + ] +interface: phpmethod +operation: ~ +optional: false +--- +source: + file: apiargs-common-param.yaml + ref: $options +... diff --git a/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml index 1593a191b4d5685eb22cdf1d7f6dfb5770495ef8..8c775dde0aaa0ea4633b2a8081fcc8555cc9ecd7 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml @@ -1,8 +1,8 @@ source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern - file: apiargs-common-option.yaml -operation: MongoDB\\Collection::deleteMany -replacement: - resource: "delete" -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml index c304607c9e2b909f0c1f46262a773eccbaabbc93..92797eb53300474be133459bb267341935b0faf8 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml @@ -1,14 +1,11 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::deleteMany +optional: false replacement: - verb: "delete" -position: 1 + action: " to delete" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::deleteMany -position: 2 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml index 55bd14adaf8414b4ade8ff57e56af3d441bb7229..8c775dde0aaa0ea4633b2a8081fcc8555cc9ecd7 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml @@ -1,8 +1,8 @@ source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern - file: apiargs-common-option.yaml -operation: MongoDB\\Collection::deleteOne -replacement: - resource: "delete" -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml index 1ab606993f63fb74b9658dbc708c379f2ce8eb10..92797eb53300474be133459bb267341935b0faf8 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml @@ -1,14 +1,11 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::deleteOne +optional: false replacement: - verb: "delete" -position: 1 + action: " to delete" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::deleteOne -position: 2 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml index 6c1ad5687c935cd4719ec44445440e5033e6d1d8..e8608b38ea10514ba646a9f7ae1a122f096e95d6 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml @@ -1,21 +1,16 @@ source: - ref: maxTimeMS + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +--- +source: file: apiargs-common-option.yaml -operation: MongoDB\\Collection::distinct -position: 1 + ref: maxTimeMS --- source: + file: apiargs-MongoDBCollection-common-option.yaml ref: readConcern - file: apiargs-common-option.yaml -operation: MongoDB\\Collection::distinct -replacement: - resource: "distinct" -position: 2 --- source: + file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference - file: apiargs-common-option.yaml -replacement: - resource: "distinct" -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml index c5396306c4925c1a090b2e539a7e98713085c8fa..37cd9b50b22323d6d28d33594513207cf93f057c 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml @@ -4,19 +4,17 @@ type: string description: | The field for which to return distinct values. interface: phpmethod -operation: MongoDB\\Collection::distinct +operation: ~ optional: false -position: 1 --- source: - file: apiargs-common-param.yaml + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter -position: 2 optional: true +replacement: + action: " from which to retrieve the distinct values" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::count -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml index 5286e3d4acb846ab28631bf6ec767e6fcba8ecb1..6460329fe39d2f510a1c20e496b233248716ecbc 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml @@ -1,6 +1,13 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::drop -position: 1 +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml index 8d7bb4a356823868ce26c18e213a6e7d18ce8e33..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml @@ -1,7 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -interface: phpmethod -operation: MongoDB\\Collection::drop -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml index ba694f7fce057ef3fd1785f8d92a2d88a3ec5dd0..6460329fe39d2f510a1c20e496b233248716ecbc 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml @@ -1,6 +1,13 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::dropIndex -position: 1 +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml index 316f5caad34367457b1b10798ce8e795a676ece0..53061d16912d0c83298bd8253add7c2847f111c9 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml @@ -2,18 +2,14 @@ arg_name: param name: $indexName type: string description: | - The name of the index to drop. View the existing indexes on the - collection using the :phpmethod:`listIndexes - <MongoDB\\Collection::listIndexes>` method. + The name of the index to drop. View the existing indexes on the collection + using the :phpmethod:`listIndexes() <MongoDB\\Collection::listIndexes>` + method. interface: phpmethod -operation: MongoDB\\Collection::dropIndex +operation: ~ optional: false -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -interface: phpmethod -operation: MongoDB\\Collection::dropIndex -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml index a7284fa05333d2df417ba94885916fcf82d93007..6460329fe39d2f510a1c20e496b233248716ecbc 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml @@ -1,6 +1,13 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::dropIndexes -position: 1 +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml index 02215c5656314c6790c2920a3852fabc1c9cebf7..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::dropIndexes -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml index bcd01a65e60868de6bee4508dbbdf3e57c552d54..b5ffe9c9c0f635342a2eae90791e56feb5310b8c 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -1,166 +1,146 @@ -name: sort +arg_name: option +name: projection type: array|object -optional: true description: | - The sort specification for the ordering of the results. -arg_name: field -operation: MongoDB\\Collection::find + The :ref:`projection specification <projections>` to determine which fields to + include in the returned documents. See :manual:`Project Fields to Return from + Query </tutorial/project-fields-from-query-results>` and + :manual:`Projection Operators </reference/operator/projection>` in the MongoDB + manual. interface: phpmethod -position: 2 +operation: ~ +optional: true --- -name: projection +arg_name: option +name: sort type: array|object -optional: true description: | - The :ref:`projection specification <projections>` to determine - which fields to include in the returned documents. See - :manual:`Project Fields to Return from Query - </tutorial/project-fields-from-query-results>` in the MongoDB - manual. -arg_name: field -operation: MongoDB\\Collection::find + The sort specification for the ordering of the results. interface: phpmethod -position: 1 +operation: ~ +optional: true --- +arg_name: option name: skip type: integer -optional: true description: | - Number of documents to skip. Defaults to 0. -arg_name: field -operation: MongoDB\\Collection::find + Number of documents to skip. Defaults to ``0``. interface: phpmethod -position: 3 +operation: ~ +optional: true --- +arg_name: option name: limit type: integer -optional: true description: | - The maximum number of documents to return. If unspecified, - then defaults to no limit. A limit of 0 is equivalent to setting no - limit. -arg_name: field -operation: MongoDB\\Collection::find + The maximum number of documents to return. If unspecified, then defaults to no + limit. A limit of ``0`` is equivalent to setting no limit. interface: phpmethod -position: 4 +operation: ~ +optional: true --- +arg_name: option name: batchSize type: integer -optional: true description: | - The number of documents to return in the first batch. - Defaults to 101. A batchSize of 0 means that the cursor will be - established, but no documents will be returned in the first batch. + The number of documents to return in the first batch. Defaults to ``101``. A + batchSize of ``0`` means that the cursor will be established, but no documents + will be returned in the first batch. - Unlike the previous wire protocol version, a batchSize of 1 for - the :dbcommand:`find` command does not close the cursor. -arg_name: field -operation: MongoDB\\Collection::find + Unlike the previous wire protocol version, a batchSize of ``1`` for the + :dbcommand:`find` command does not close the cursor. interface: phpmethod -position: 5 +operation: ~ +optional: true --- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +--- +arg_name: option name: comment type: string -optional: true description: | - A comment to attach to the query to help interpret and trace query - :dbcommand:`profile` data. -arg_name: field -operation: MongoDB\\Collection::find + A comment to attach to the query to help interpret and trace query + :dbcommand:`profile` data. interface: phpmethod -position: 6 +operation: ~ +optional: true --- arg_name: option name: cursorType type: integer description: | - Indicates the type of cursor to use. ``cursorType`` supports the following - values: + Indicates the type of cursor to use. ``cursorType`` supports the following + values: - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*) - ``MongoDB\Operation\Find::TAILABLE`` interface: phpmethod -operation: MongoDB\\Collection::find +operation: ~ optional: true -position: 7 --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::find -position: 8 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readConcern -operation: MongoDB\\Collection::find -position: 9 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference -pre: | - For use with MongoDB 3.0 and earlier. -operation: MongoDB\\Collection::find -position: 10 --- +arg_name: option name: oplogReplay type: boolean -optional: true description: | - Internal use for replica sets. To use oplogReplay, you must include - the following condition in the filter: + Internal use for replica sets. To use ``oplogReplay``, you must include the + following condition in the filter: - .. code-block:: javascript + .. code-block:: javascript - { ts: { $gte: <timestamp> } } + { ts: { $gte: <timestamp> } } - The :php:`MongoDB\\BSON\\Timestamp <class.mongodb-bson-timestamp>` - class reference describes how to represent MongoDB's BSON - timestamp type with PHP. -arg_name: field -operation: MongoDB\\Collection::find + The :php:`MongoDB\\BSON\\Timestamp <class.mongodb-bson-timestamp>` class + reference describes how to represent MongoDB's BSON timestamp type with PHP. interface: phpmethod -position: 11 +operation: ~ +optional: true --- +arg_name: option name: noCursorTimeout type: boolean -optional: true description: | - Prevents the server from timing out idle cursors after an inactivity - period (10 minutes). -arg_name: field -operation: MongoDB\\Collection::find + Prevents the server from timing out idle cursors after an inactivity period + (10 minutes). interface: phpmethod -position: 12 +operation: ~ +optional: true --- +arg_name: option name: allowPartialResults type: boolean -optional: true description: | - For queries against a sharded collection, returns partial results from - the :program:`mongos` if some shards are unavailable instead of - throwing an error. -arg_name: field -operation: MongoDB\\Collection::find + For queries against a sharded collection, returns partial results from the + :program:`mongos` if some shards are unavailable instead of throwing an error. interface: phpmethod -position: 13 +operation: ~ +optional: true --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::find -position: 14 --- arg_name: option name: modifiers -type: array +type: array|object description: | - Meta-operators that modify the output or behavior of a query. - :manual:`Cursor Methods </reference/method/js-cursor`> describes the - query modification methods available in MongoDB. + Meta-operators that modify the output or behavior of a query. :manual:`Cursor + Methods </reference/method/js-cursor`> describes the query modification + methods available in MongoDB. interface: phpmethod -operation: MongoDB\\Collection::find +operation: ~ optional: true -position: 15 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml index 4c2e6c51361a6bd50c78061881d8bc420a187c05..5683a7bba7b0787deb5d01a1dc92fbdc73d08d32 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml @@ -1,14 +1,11 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::find +optional: true replacement: - verb: "query" -position: 1 + action: " to query" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::find -position: 2 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml index 425b19e2fe5a1494b5076de8312c589a2a7c0a34..4e3793e362cb167b673fc62829ce6edcf6a54cb2 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml @@ -1,56 +1,42 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: projection -operation: MongoDB\\Collection::findOne -position: 1 --- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: sort -operation: MongoDB\\Collection::findOne -position: 2 --- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: skip -operation: MongoDB\\Collection::findOne -position: 3 --- source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: comment -operation: MongoDB\\Collection::findOne -position: 4 + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: file: apiargs-MongoDBCollection-method-find-option.yaml - ref: modifiers -operation: MongoDB\\Collection::findOne -position: 5 + ref: comment --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::findOne -position: 6 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readConcern -operation: MongoDB\\Collection::findOne -position: 7 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference -pre: | - For use with MongoDB 3.0 and earlier. -operation: MongoDB\\Collection::findOne -position: 8 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::findOne -position: 9 +post: | + This will be used for the returned result document. +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: modifiers ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml index fc93433457d6e198bb6f6d6d891203dc59765dbe..5683a7bba7b0787deb5d01a1dc92fbdc73d08d32 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml @@ -1,14 +1,11 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOne +optional: true replacement: - verb: "query" -position: 1 + action: " to query" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOne -position: 2 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml index f75b78c348db5d23c66065f21d31fa1969626506..066a471403ea14e1275f2c81a0b02c00ad25fbec 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -1,24 +1,23 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: projection -operation: MongoDB\\Collection::findOneAndDelete -position: 1 --- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: sort -operation: MongoDB\\Collection::findOneAndDelete -position: 2 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::findOneAndDelete -position: 3 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::findOneAndDelete -position: 4 +post: | + This is not supported for server versions prior to 3.2 and will be ignored if + used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml index 296ecf51e17b691e2a7daacc7dc7334585288a33..92797eb53300474be133459bb267341935b0faf8 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml @@ -1,14 +1,11 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndDelete +optional: false replacement: - verb: "query" -position: 1 + action: " to delete" --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndDelete -position: 2 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml index 11cacf60891c19d6013df66c9b108838f148405e..8dd5745a22e5d33e23758325739942637024cf35 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -1,50 +1,44 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: projection -operation: MongoDB\\Collection::findOneAndReplace -position: 1 --- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: sort -operation: MongoDB\\Collection::findOneAndReplace -position: 2 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Collection::findOneAndReplace -position: 3 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::findOneAndReplace -position: 4 --- arg_name: option name: returnDocument type: integer description: | - Specifies whether to return the document before the replacementi applied, or + Specifies whether to return the document before the replacement is applied, or after. ``returnDocument`` supports the following values: - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*) - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`` interface: phpmethod -operation: MongoDB\Collection::findOneAndUpdate +operation: ~ optional: true -position: 5 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: upsert -operation: MongoDB\\Collection::findOneAndReplace -position: 6 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::findOneAndReplace -position: 7 +post: | + This is not supported for server versions prior to 3.2 and will be ignored if + used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml index 9d6d93664383adf08e5e3c4e639325956c595078..32ed6b35f8986da96f1dde1789dd8cd88bc56a78 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml @@ -1,25 +1,15 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndReplace -replacement: - verb: "query" optional: false -position: 1 +replacement: + action: " to replace" --- -arg_name: param -name: $replacement -type: array|object -description: | - The document to replace. -interface: phpmethod -operation: MongoDB\\Collection::findOneAndReplace -optional: false -position: 2 +source: + file: apiargs-MongoDBCollection-common-param.yaml + ref: $replacement --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndReplace -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml index 3dcd30fae82185f36bb50dc8e9aa8ffe591f8455..4da7703f87a65c1ab5c3fa6761cb1645e70e3b0e 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -1,26 +1,22 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: projection -operation: MongoDB\Collection::findOneAndUpdate -position: 1 --- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: sort -operation: MongoDB\Collection::findOneAndUpdate -position: 2 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\Collection::findOneAndUpdate -position: 3 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\Collection::findOneAndUpdate -position: 4 --- arg_name: option name: returnDocument @@ -32,19 +28,17 @@ description: | - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*) - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER`` interface: phpmethod -operation: MongoDB\Collection::findOneAndUpdate +operation: ~ optional: true -position: 5 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: upsert -operation: MongoDB\\Collection::findOneAndUpdate -position: 6 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\Collection::findOneAndUpdate -position: 7 +post: | + This is not supported for server versions prior to 3.2 and will be ignored if + used. ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml index 399cef0683031d4763184b6e9de6672946d5b386..a335678a3ebdf04603383d73a73a1ede41f32ff2 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml @@ -1,27 +1,15 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndUpdate -replacement: - verb: "query" optional: false -position: 1 +replacement: + action: " to update" --- -arg_name: param -name: $update -type: array|object -description: | - Specifies the field and value combinations to update and any - relevant update operators. ``$update`` uses MongoDB's - :method:`update operators </reference/operator/update>`. -interface: phpmethod -operation: MongoDB\\Collection::findOneAndUpdate -optional: false -position: 2 +source: + file: apiargs-MongoDBCollection-common-param.yaml + ref: $update --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::findOneAndUpdate -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml index 01330fcf4968195c183f680eba6ab1f15ee38b57..1b32b97abdadddacd695d176770854a99cf5b6fe 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml @@ -1,18 +1,12 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::insertMany -position: 1 --- source: file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml ref: ordered -operation: MongoDB\\Collection::insertMany -position: 2 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::insertMany -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml index 35d8f609463b6703e9c02add78cc2dd23f78136f..78246d30dd13e1ce48cb2e0276d50d750712bd47 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml @@ -4,13 +4,10 @@ type: array description: | The documents to insert into the collection. interface: phpmethod -operation: MongoDB\\Collection::insertMany +operation: ~ optional: false -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::insertMany -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml index 33b3cb9a16dad0132921719ba587dbd8b5acd571..ee47d57539c5c98be0a243991c2e9b21120030eb 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml @@ -1,12 +1,8 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::insertOne -position: 1 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::insertOne -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml index 1ab570007048c799cb580bafb7d4118d4410d54f..5dc231d308bccd020897d0e297e31ec738003e14 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml @@ -4,13 +4,10 @@ type: array|object description: | The document to insert into the collection. interface: phpmethod -operation: MongoDB\\Collection::insertOne +operation: ~ optional: false -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::insertOne -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml index 97a3be6e84b28cad282b2eca5d7141b8c8698957..4eb407fe740311bc89466ff18cc19b7f385c885a 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml @@ -1,6 +1,4 @@ source: - ref: maxTimeMS file: apiargs-common-option.yaml -operation: MongoDB\\Collection::listIndexes -position: 1 + ref: maxTimeMS ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml index b708486e2646fb6dd44649a1291543122134ff7e..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml @@ -1,6 +1,4 @@ source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::listIndexes -position: 1 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml index 09ca49f3bd3bffee3feb80de03722810f7e040c6..4fec2f0590d909342f3bf0e344b5b08c6731d413 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml @@ -1,18 +1,16 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml + ref: upsert +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::replaceOne -position: 1 --- source: - file: apiargs-common-option.yaml - ref: upsert -operation: MongoDB\\Collection::replaceOne -position: 2 + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::replaceOne -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml index 7a730cfc4c1a936fabb8d5884618e2684310894b..32ed6b35f8986da96f1dde1789dd8cd88bc56a78 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml @@ -1,25 +1,15 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::replaceOne -replacement: - verb: "query" optional: false -position: 1 +replacement: + action: " to replace" --- -arg_name: param -name: $replacement -type: array -description: | - The document to replace. -interface: phpmethod -operation: MongoDB\\Collection::replaceOne -optional: false -position: 2 +source: + file: apiargs-MongoDBCollection-common-param.yaml + ref: $replacement --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::replaceOne -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml index 128c8ea219e9875865ac0c6a89fdf8f403771ffb..4fec2f0590d909342f3bf0e344b5b08c6731d413 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml @@ -1,18 +1,16 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml + ref: upsert +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::updateMany -position: 1 --- source: - file: apiargs-common-option.yaml - ref: upsert -operation: MongoDB\\Collection::updateMany -position: 2 + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::updateMany -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml index 12137ffc81e6144cb633c7f3aaba06b59c4899b1..a335678a3ebdf04603383d73a73a1ede41f32ff2 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml @@ -1,22 +1,15 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::updateMany -replacement: - verb: "query" optional: false -position: 1 +replacement: + action: " to update" --- source: - file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml + file: apiargs-MongoDBCollection-common-param.yaml ref: $update -operation: MongoDB\\Collection::updateMany -optional: false -position: 2 --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::updateMany -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml index 80ce3e62dff1883209e3243822c772c076bcfe5b..4fec2f0590d909342f3bf0e344b5b08c6731d413 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml @@ -1,18 +1,16 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml + ref: upsert +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation -operation: MongoDB\\Collection::updateOne -position: 1 --- source: - file: apiargs-common-option.yaml - ref: upsert -operation: MongoDB\\Collection::updateOne -position: 2 + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::updateOne -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml index d61c8b2a7bfc7f3f5d774a12c097f62751306ddc..a335678a3ebdf04603383d73a73a1ede41f32ff2 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml @@ -1,22 +1,15 @@ source: + file: apiargs-MongoDBCollection-common-param.yaml ref: $filter - file: apiargs-common-param.yaml -operation: MongoDB\\Collection::updateOne -replacement: - verb: "query" optional: false -position: 1 +replacement: + action: " to update" --- source: - file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml + file: apiargs-MongoDBCollection-common-param.yaml ref: $update -operation: MongoDB\\Collection::updateOne -optional: false -position: 2 --- source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::updateOne -position: 3 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml index 53128b2d8bf23536564bbbd13258185c993971c0..681144f3a66f8a85e920c63b99e490831e139e40 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml @@ -1,32 +1,27 @@ source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Collection::withOptions -description: | - The default read concern to use for collection operations. Defaults - to the original Collection's specified read concern. +replacement: + resource: "collection" + parent: "original collection" --- source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Collection::withOptions -description: | - The default read preference to use for collection operations. - Defaults to the original Collection's read preference. +replacement: + resource: "collection" + parent: "original collection" --- source: file: apiargs-common-option.yaml ref: typeMap -operation: MongoDB\\Collection::withOptions -description: | - Default type map for cursors and BSON documents. Defaults to the - original Collection's type map value. +replacement: + parent: "original collection" --- source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Collection::withOptions -description: | - The default write concern to use for collection operations. Defaults - to the original Collection's specified write concern. +replacement: + resource: "collection" + parent: "original collection" ... diff --git a/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml index 72c3a4539c87f1e4e1e85b5a68b289dc4c539973..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml +++ b/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml @@ -1,6 +1,4 @@ source: - ref: $options file: apiargs-common-param.yaml -operation: MongoDB\\Collection::withOptions -position: 1 + ref: $options ... diff --git a/docs/includes/apiargs-MongoDBDatabase-common-option.yaml b/docs/includes/apiargs-MongoDBDatabase-common-option.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c18bd678fdd44fb2e3bc7cd244c7de9941d275fb --- /dev/null +++ b/docs/includes/apiargs-MongoDBDatabase-common-option.yaml @@ -0,0 +1,16 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +replacement: + parent: "database" +--- +arg_name: option +name: writeConcern +type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` +description: | + :manual:`Write concern </reference/write-concern>` to use for the operation. + Defaults to the database's write concern. +interface: phpmethod +operation: ~ +optional: true +... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml index fa53aebace66a5365ea617919bc26262293626cd..7dc5b5a0b02ca0485ce5a44c756ce7c9b9b37256 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml @@ -1,20 +1,11 @@ source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Database::command -position: 1 description: | - The read preference to use when executing the command. This may be used when - issuing the command to a replica set or shard cluster to ensure that the - driver sets the wire protocol accordingly or adds the read preference to the - command document, respectively. Defaults to the Database's read preference. + :manual:`Read preference </reference/read-preference>` to use for the + operation. Defaults to the database's read preference. --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBDatabase-common-option.yaml ref: typeMap -operation: MongoDB\\Database::command -position: 2 -description: | - Type map for BSON deserialization. This will be applied to the returned - cursor. Defaults to the database's type map. ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml index bcf5b92c37d30712af90c7611a3e85a85c978d52..5a4b03d7bd484ee1e7cef74308e70276a20eb2ab 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml @@ -4,13 +4,10 @@ type: array|object description: | The :manual:`database command </reference/command>` document. interface: phpmethod -operation: MongoDB\\Database::command +operation: ~ optional: false -position: 1 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::command -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml index 4f52540f6d82974d25a3d87c2b8638bc2f81c286..d398069a8873be7f32188b69b2b82cbf3817ef97 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml @@ -1,8 +1,6 @@ source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Database::__construct -position: 1 replacement: resource: "database" parent: "manager" @@ -10,39 +8,17 @@ replacement: source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Database::__construct -position: 2 replacement: resource: "database" parent: "manager" --- -arg_name: option -name: typeMap -type: array -description: | - Default :php:`type map - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to cursors. The type map determines how BSON documents are converted - to PHP values which determines. The |php-library| uses the following type map - by default: - - .. code-block:: php - - [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ] -interface: phpmethod -operation: MongoDB\\Database::__construct -optional: true -position: 3 +source: + file: apiargs-MongoDBClient-method-construct-driverOptions.yaml + ref: typeMap --- source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Database::__construct -position: 4 replacement: resource: "database" parent: "manager" diff --git a/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml index 4f71dd08acc5cef6412b9596989ab65fb04ec54a..5ef826c175444b2b9ebac88b1789ac5c3e0cc7d6 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml @@ -1,18 +1,12 @@ source: file: apiargs-common-param.yaml ref: $manager -operation: MongoDB\\Database::__construct -position: 1 --- source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\Database::__construct -position: 2 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Collection::__construct -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 781c54a46a28136a9bac997de814b219ac25879b..d70a905fe4aa216fc74c8ab9917182446b1bbb1f 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -11,9 +11,8 @@ description: | .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 1 --- arg_name: option name: capped @@ -22,9 +21,15 @@ description: | To create a capped collection, specify ``true``. If you specify ``true``, you must also set a maximum size in the ``size`` option. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 3 +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: collation +pre: | + Specifies the :manual:`collation + </reference/bson-type-comparison-order/#collation>` for the collection. --- arg_name: option name: flags @@ -48,9 +53,8 @@ description: | :manual:`db.createCollection() </reference/method/db.createCollection>` for more information. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 4 --- arg_name: option name: indexOptionDefaults @@ -68,31 +72,26 @@ description: | and logged to the :term:`oplog` during replication to support replica sets with members that use different storage engines. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 5 --- arg_name: option name: max type: integer description: | - The maximum number of documents allowed in the capped collection. The - ``size`` option takes precedence over this limit. If a capped - collection reaches the ``size`` limit before it reaches the maximum - number of documents, MongoDB removes old documents. If you prefer to - use the ``max`` limit, ensure that the ``size`` limit, which is - required for a capped collection, is sufficient to contain the - maximum number of documents. + The maximum number of documents allowed in the capped collection. The ``size`` + option takes precedence over this limit. If a capped collection reaches the + ``size`` limit before it reaches the maximum number of documents, MongoDB + removes old documents. If you prefer to use the ``max`` limit, ensure that the + ``size`` limit, which is required for a capped collection, is sufficient to + contain the maximum number of documents. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 6 --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Database::createCollection -position: 7 --- arg_name: option name: size @@ -103,9 +102,8 @@ description: | make space for the new documents. The ``size`` option is required for capped collections and ignored for other collections. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 8 --- arg_name: option name: storageEngine @@ -123,18 +121,14 @@ description: | validated and logged to the :term:`oplog` during replication to support replica sets with members that use different storage engines. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 9 --- source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBDatabase-common-option.yaml ref: typeMap -operation: MongoDB\\Database::createCollection -position: 10 -description: | - Type map for BSON deserialization. This will be used for the returned command - result document. Defaults to the database's type map. +post: | + This will be used for the returned command result document. --- arg_name: option name: validator @@ -160,10 +154,9 @@ description: | ``local``, and ``config`` databases. - You cannot specify a validator for ``system.*`` collections. -operation: MongoDB\\Database::createCollection +operation: ~ interface: phpmethod optional: true -position: 11 --- arg_name: option name: validationAction @@ -194,9 +187,8 @@ description: | - Documents do not have to pass validation. If the document fails validation, the write operation logs the validation failure. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 12 --- arg_name: option name: validationLevel @@ -226,7 +218,13 @@ description: | documents. Do not apply rules to updates on existing *invalid* documents. interface: phpmethod -operation: MongoDB\\Database::createCollection +operation: ~ optional: true -position: 13 +--- +source: + file: apiargs-MongoDBDatabase-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml index c8c40ce9710179c54ca77e625f1222e88a904e36..b6bb2dccd669d3113492157d86ac0254389a5a0e 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml @@ -1,14 +1,10 @@ source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Database::createCollection -position: 1 replacement: action: " to create" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::createCollection -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml index f9b8e81ae1189590f10a57cf168b95a77e03188d..630c1bd142697008d82b8427ca02210990149a45 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml @@ -1,9 +1,13 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBDatabase-common-option.yaml ref: typeMap -operation: MongoDB\\Database::drop -position: 1 -description: | - Type map for BSON deserialization. This will be used for the returned command - result document. Defaults to the database's type map. +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBDatabase-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml index 53b1e8a9485bd2e400e0d1ebe0035689c624722f..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::drop -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml index 4e8919fe212886d57549f4cd1e45d46cdeaf73f0..630c1bd142697008d82b8427ca02210990149a45 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml @@ -1,9 +1,13 @@ source: - file: apiargs-common-option.yaml + file: apiargs-MongoDBDatabase-common-option.yaml ref: typeMap -operation: MongoDB\\Database::dropCollection -position: 1 -description: | - Type map for BSON deserialization. This will be used for the returned command - result document. Defaults to the database's type map. +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBDatabase-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml index 1e260bc3f7f85a37684df008afa115e72ad6870c..c8e0a614e7125f9951a8af44b3dafa15169c2b52 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml @@ -1,14 +1,10 @@ source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Database::dropCollection -position: 1 replacement: action: " to drop" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::dropCollection -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml index 331e02c836c72a2f4558e613f86e2443be5eccbc..651c85f949840464c61dd40ce6e8001eeeaaffec 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml @@ -1,8 +1,6 @@ source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Database::__get -position: 1 replacement: action: " to select" ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml index 0d7409d0af42c249ebeb8906d3ce81267dfa4c46..c8bcc2c5ee1ef4833e40a345bcf7ece7e38b1b35 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml @@ -2,15 +2,14 @@ arg_name: option name: filter type: array|object description: | - Query by which to filter collections. + A query expression to filter the list of collections. + + You can specify a query expression on the collection ``name`` and ``options``. interface: phpmethod -operation: MongoDB\\Database::listCollections +operation: ~ optional: true -position: 1 --- source: file: apiargs-common-option.yaml ref: maxTimeMS -operation: MongoDB\\Database::listCollections -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml index e717699d2fa62e7311b1139c7166303e4a0b83bb..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::listCollections -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml index bf8b85e9a94f6a789a0b06b435c9dc17c967ddee..932c1b16ba0e055f43424ba0bc6e247d38e8cf6f 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml @@ -1,8 +1,6 @@ source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Database::selectCollection -position: 1 replacement: resource: "collection" parent: "database" @@ -10,8 +8,6 @@ replacement: source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Database::selectCollection -position: 2 replacement: resource: "collection" parent: "database" @@ -19,16 +15,12 @@ replacement: source: file: apiargs-common-option.yaml ref: typeMap -operation: MongoDB\\Database::selectCollection -position: 3 replacement: parent: "database" --- source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Database::selectCollection -position: 4 replacement: resource: "collection" parent: "database" diff --git a/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml index 2f3cd0440382119c98f3e605e154d1d3ed9ed34a..46d4e72a6322801f8f79b16545991a3330f37909 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml @@ -1,14 +1,10 @@ source: file: apiargs-common-param.yaml ref: $collectionName -operation: MongoDB\\Database::selectCollection -position: 1 replacement: action: " to select" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::selectCollection -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml index e43b24674e8034e4944cd7c94d503f8816d9ced5..999b2c1f865d7653fb0f50ad460de6f84dff724d 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml @@ -5,9 +5,8 @@ description: | The bucket name, which will be used as a prefix for the files and chunks collections. Defaults to ``"fs"``. interface: phpmethod -operation: MongoDB\\Database::selectGridFSBucket +operation: ~ optional: true -position: 1 --- arg_name: option name: chunkSizeBytes @@ -15,15 +14,12 @@ type: integer description: | The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). interface: phpmethod -operation: MongoDB\\Database::selectGridFSBucket +operation: ~ optional: true -position: 2 --- source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Database::selectGridFSBucket -position: 3 replacement: resource: "bucket" parent: "database" @@ -31,8 +27,6 @@ replacement: source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Database::selectGridFSBucket -position: 4 replacement: resource: "bucket" parent: "database" @@ -40,8 +34,6 @@ replacement: source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Database::selectGridFSBucket -position: 5 replacement: resource: "bucket" parent: "database" diff --git a/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml index 9b1a67b3877f9e037b5acb5a57405a011956ccbd..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::selectGridFSBucket -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml index d08427bee0feb80deea7b8ebe8bf84c2f07160a2..c048182c1751d76c6bab2708e4ddef0d9d793747 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml @@ -1,32 +1,27 @@ source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\Database::withOptions -description: | - The default read concern to use for database operations. Defaults to the - original Databases's read concern. +replacement: + resource: "database" + parent: "original database" --- source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\Database::withOptions -description: | - The default read preference to use for database operations. Defaults to the - original Database's read preference. +replacement: + resource: "database" + parent: "original database" --- source: file: apiargs-common-option.yaml ref: typeMap -operation: MongoDB\\Database::withOptions -description: | - Default type map to use for converting BSON. Defaults to the original - Database's type map. +replacement: + parent: "original database" --- source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\Database::withOptions -description: | - The default write concern to use for database operations. Defaults to the - original Database's write concern. +replacement: + resource: "database" + parent: "original database" ... diff --git a/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml index 53504d42b22218ad6f37808a89f0d191971ebc5f..73ad04d0ba16b0e6efced8a891de73f14845c3d0 100644 --- a/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml +++ b/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml @@ -1,6 +1,4 @@ source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\Database::withOptions -position: 1 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8c6470d872ce0591262a4b4d363d7a80c3e88dd0 --- /dev/null +++ b/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml @@ -0,0 +1,50 @@ +arg_name: option +name: _id +type: mixed +description: | + Value to use as the file document identifier. Defaults to a new + :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: chunkSizeBytes +type: integer +description: | + The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: metadata +type: array|object +description: | + User data for the ``metadata`` field of the file document. If not specified, + the ``metadata`` field will not be set on the file document. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: revision +type: integer +description: | + The revision of the file to retrieve. Files with the name ``filename`` will be + differentiated by their ``uploadDate`` field. + + Revision numbers are defined as follows: + + - 0 = the original stored file + - 1 = the first revision + - 2 = the second revision + - etc... + - -2 = the second most recent revision + - -1 = the most recent revision + + Defaults to -1 (i.e. the most recent revision). +interface: phpmethod +operation: ~ +optional: true +... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f1d6b136a8e1e1a2c695143c10afb5e50bad06e6 --- /dev/null +++ b/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml @@ -0,0 +1,39 @@ +arg_name: param +name: $filename +type: string +description: | + The ``filename`` of the file{{action}}. +interface: phpmethod +operation: ~ +optional: false +replacement: + action: "" +--- +arg_name: param +name: $id +type: mixed +description: | + The ``_id`` of the file{{action}}. +interface: phpmethod +operation: ~ +optional: false +replacement: + action: "" +--- +arg_name: param +name: $stream +type: resource +description: | + The GridFS stream resource. +interface: phpmethod +operation: ~ +--- +arg_name: param +name: $destination +type: resource +description: | + Writable stream, to which the GridFS file's contents will be written. +interface: phpmethod +operation: ~ +optional: false +... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml index 467800d775f311152b3237a0294d1d1e332775b9..999b2c1f865d7653fb0f50ad460de6f84dff724d 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml @@ -5,9 +5,8 @@ description: | The bucket name, which will be used as a prefix for the files and chunks collections. Defaults to ``"fs"``. interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::__construct +operation: ~ optional: true -position: 1 --- arg_name: option name: chunkSizeBytes @@ -15,15 +14,12 @@ type: integer description: | The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::__construct +operation: ~ optional: true -position: 2 --- source: file: apiargs-common-option.yaml ref: readConcern -operation: MongoDB\\GridFS\\Bucket::__construct -position: 3 replacement: resource: "bucket" parent: "database" @@ -31,8 +27,6 @@ replacement: source: file: apiargs-common-option.yaml ref: readPreference -operation: MongoDB\\GridFS\\Bucket::__construct -position: 4 replacement: resource: "bucket" parent: "database" @@ -40,8 +34,6 @@ replacement: source: file: apiargs-common-option.yaml ref: writeConcern -operation: MongoDB\\GridFS\\Bucket::__construct -position: 5 replacement: resource: "bucket" parent: "database" diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml index f22a31bc8020e9fc4a80b810be4250ac5b0f2792..5ef826c175444b2b9ebac88b1789ac5c3e0cc7d6 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml @@ -1,18 +1,12 @@ source: file: apiargs-common-param.yaml ref: $manager -operation: MongoDB\\GridFS\\Bucket::__construct -position: 1 --- source: file: apiargs-common-param.yaml ref: $databaseName -operation: MongoDB\\GridFS\\Bucket::__construct -position: 2 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\GridFS\\Bucket::__construct -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml index b8d289f83dbe9f9e14650f87e2ed549139c53403..7e8baa214420494e3ae9a9bbed00339cc51475d9 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml @@ -1,10 +1,6 @@ -arg_name: param -name: $id -type: mixed -description: | - The ``_id`` of the file to delete. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::delete -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $id +replacement: + resource: " to delete" ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml index 4eda59ba2477e54f50f564f4657c36ce0578a511..39d48dc5da6dabdaccfae9d60b8d78353b03e13c 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml @@ -1,20 +1,10 @@ -arg_name: param -name: $id -type: mixed -description: | - The ``_id`` of the file to download. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::downloadToStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $id +replacement: + resource: " to download" --- -arg_name: param -name: $destination -type: resource -description: | - Writable stream where the GridFS file's contents will be written. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::downloadToStream -optional: false -position: 2 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $destination ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml index 3ad8a2205de5a6001aca5dfd525450d2d2fac599..9dc941d97354a9c9997ef7baeefa6c681e644b3e 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml @@ -1,22 +1,4 @@ -arg_name: option -name: revision -type: integer -description: | - The revision of the file to retrieve. Files with the name ``filename`` will be - differentiated by their ``uploadDate`` field. - - Revision numbers are defined as follows: - - - 0 = the original stored file - - 1 = the first revision - - 2 = the second revision - - etc... - - -2 = the second most recent revision - - -1 = the most recent revision - - Defaults to -1 (i.e. the most recent revision). -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName -optional: true -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: revision ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml index b09f9a370163e9a4f52eabbac6980541ce8868fe..2704877be2c3a8d807531ac28f34a93d650e3c0f 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml @@ -1,26 +1,14 @@ -arg_name: param -name: $filename -type: string -description: | - The ``filename`` of the file to download. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $filename +replacement: + resource: " to download" --- -arg_name: param -name: $destination -type: resource -description: | - Writable stream where the GridFS file's contents will be written. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName -optional: false -position: 2 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $destination --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName -position: 3 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml index e66048815d0d06e28caf219d3b74142c64b4a925..0801cb21d716912347a01035158ac045d866b25e 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml @@ -1,10 +1,4 @@ -arg_name: param -name: $stream -type: resource -description: | - The GridFS stream resource. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::getFileDocumentForStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $stream ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml index 98c5fb65e02f51a855df4fb67bd66f03dedcefc1..0801cb21d716912347a01035158ac045d866b25e 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml @@ -1,10 +1,4 @@ -arg_name: param -name: $stream -type: resource -description: | - The GridFS stream resource. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::getFileIdForStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $stream ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml index a138da9b7c7d3329642c40fe6b38b45a6efb8cc9..54e7c8c211acf7665fd2019b3e2d13e0faf568e6 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml @@ -1,10 +1,6 @@ -arg_name: param -name: $id -type: mixed -description: | - The ``_id`` of the file to download. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openDownloadStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $id +replacement: + resource: " to download" ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml index 2fb3708358e5ac699620f4f486da30fc381fc9d2..9dc941d97354a9c9997ef7baeefa6c681e644b3e 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml @@ -1,22 +1,4 @@ -arg_name: option -name: revision -type: integer -description: | - The revision of the file to retrieve. Files with the name ``filename`` will be - differentiated by their ``uploadDate`` field. - - Revision numbers are defined as follows: - - - 0 = the original stored file - - 1 = the first revision - - 2 = the second revision - - etc... - - -2 = the second most recent revision - - -1 = the most recent revision - - Defaults to -1 (i.e. the most recent revision). -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName -optional: true -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: revision ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml index 2ca8b28df5756005441d78dc19da1e334799f858..eb8ec932cc06265b5a059701438862fbf20c0751 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml @@ -1,16 +1,10 @@ -arg_name: param -name: $filename -type: string -description: | - The ``filename`` of the file to download. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $filename +replacement: + resource: " to download" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml index ef03e8e4c5ee956f9b6236406d3bc722e1a59f94..6c4d2ff69ff36c1536821d0e7e6932a0cdda9792 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml @@ -1,32 +1,12 @@ -arg_name: option -name: _id -type: mixed -description: | - Value to use as the file document identifier. Defaults to a new - :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openUploadStream -optional: true -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: _id --- -arg_name: option -name: chunkSizeBytes -type: integer -description: | - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openUploadStream -optional: true -position: 2 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: chunkSizeBytes --- -arg_name: option -name: metadata -type: array|object -description: | - User data for the ``metadata`` field of the file document. If not specified, - the ``metadata`` field will not be set on the file document. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openUploadStream -optional: true -position: 3 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: metadata ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml index e97103dc61f9078bd9484e1719fa64217fdbd4c3..6b8efb34785438033d788ce940ad062fb8c06892 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml @@ -1,16 +1,10 @@ -arg_name: param -name: $filename -type: string -description: | - The ``filename`` of the file to create. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::openUploadStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $filename +replacement: + resource: " to create" --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\GridFS\\Bucket::openUploadStream -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml index 5dc7e42c24ed9781bf5650cfb410c5d6f6bfb881..e1b140aea92a9aedc14591a81d2daed05113eb5f 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml @@ -1,12 +1,8 @@ -arg_name: param -name: $id -type: mixed -description: | - The ``_id`` of the file to rename. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::rename -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $id +replacement: + resource: " to rename" --- arg_name: param name: $newFilename @@ -14,7 +10,6 @@ type: string description: | The new ``filename`` value. interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::rename +operation: ~ optional: false -position: 2 ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml index 546f0d6a3b983d4efc19df92984c6b451694ea6a..6c4d2ff69ff36c1536821d0e7e6932a0cdda9792 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml @@ -1,32 +1,12 @@ -arg_name: option -name: _id -type: mixed -description: | - Value to use as the file document identifier. Defaults to a new - :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::uploadFromStream -optional: true -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: _id --- -arg_name: option -name: chunkSizeBytes -type: integer -description: | - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::uploadFromStream -optional: true -position: 2 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: chunkSizeBytes --- -arg_name: option -name: metadata -type: array|object -description: | - User data for the ``metadata`` field of the file document. If not specified, - the ``metadata`` field will not be set on the file document. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::uploadFromStream -optional: true -position: 3 +source: + file: apiargs-MongoDBGridFSBucket-common-option.yaml + ref: metadata ... diff --git a/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml index 90419575324c1218f5d3bb4b432a1b8e3b3700bb..48fa2db4c1795f6e8e139740cd3f9c24fffab753 100644 --- a/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml +++ b/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml @@ -1,26 +1,19 @@ -arg_name: param -name: $filename -type: string -description: | - The ``filename`` of the file to create. -interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::uploadFromStream -optional: false -position: 1 +source: + file: apiargs-MongoDBGridFSBucket-common-param.yaml + ref: $filename +replacement: + resource: " to create" --- arg_name: param name: $source type: resource description: | - Readable stream where the file's contents will be read. + Readable stream, from which the new GridFS file's contents will be read. interface: phpmethod -operation: MongoDB\\GridFS\\Bucket::uploadFromStream +operation: ~ optional: false -position: 2 --- source: file: apiargs-common-param.yaml ref: $options -operation: MongoDB\\GridFS\\Bucket::uploadFromStream -position: 3 ... diff --git a/docs/includes/apiargs-common-option.yaml b/docs/includes/apiargs-common-option.yaml index c3709b4b0f3fdd3d1d3ac4205af5d7cdc369b890..54d6bd897f35fa2c31a23c4f24e502f0e582813f 100644 --- a/docs/includes/apiargs-common-option.yaml +++ b/docs/includes/apiargs-common-option.yaml @@ -1,4 +1,15 @@ arg_name: option +name: maxTimeMS +type: integer +description: | + The cumulative time limit in milliseconds for processing operations on the + cursor. MongoDB aborts the operation at the earliest following + :term:`interrupt point`. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: readConcern type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>` description: | @@ -7,35 +18,34 @@ description: | interface: phpmethod operation: selectCollection optional: true -position: 1 replacement: resource: "collection" parent: "client" --- arg_name: option +name: readPreference +type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>` description: | The default read preference to use for {{resource}} operations. Defaults to the {{parent}}'s read preference. interface: phpmethod -name: readPreference -operation: selectCollection +operation: ~ optional: true -position: 2 -type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>` replacement: resource: "collection" parent: "client" --- arg_name: option +name: typeMap +type: array description: | - Default type map for cursors and BSON documents. Defaults to the - {{parent}}'s type map. + The :php:`type map + <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` + to apply to cursors, which determines how BSON documents are converted to PHP + values. Defaults to the {{parent}}'s type map. interface: phpmethod -name: typeMap -operation: selectCollection +operation: ~ optional: true -position: 3 -type: array replacement: parent: "client" --- @@ -46,51 +56,9 @@ description: | The default write concern to use for {{resource}} operations. Defaults to the {{parent}}'s write concern. interface: phpmethod -operation: selectCollection +operation: ~ optional: true -position: 4 replacement: resource: "collection" parent: "client" ---- -arg_name: option -name: maxTimeMS -description: | - The cumulative time limit in milliseconds for processing operations on - the cursor. MongoDB aborts the operation at the earliest following - :term:`interrupt point`. -interface: phpmethod -operation: listDatabases -type: integer -optional: true -position: 5 ---- -arg_name: option -name: bypassDocumentValidation -type: boolean -description: | - If ``true``, allows the write operation to circumvent document level - validation. This only applies when using the :pipeline:`$out` stage. - - Document validation requires MongoDB v3.2 or later: if you are using - an earlier version of MongoDB, this option will be ignored. -interface: phpmethod -operation: aggregate -optional: true -position: 6 ---- -arg_name: option -name: upsert -type: boolean -description: | - When true, {{role}} creates a new document if no document - matches the query. If a document matches the query, {{role}} - performs an update. To avoid multiple upserts, ensure that the query - fields are uniquely indexed. - - The default is ``false``. -optional: true -interface: phpmethod -operation: MongoDB\\Collection::findOneAndUpdate -position: 7 ... diff --git a/docs/includes/apiargs-common-param.yaml b/docs/includes/apiargs-common-param.yaml index 397aff3f8af25762588fe86e236efd602aa92fe0..0f152c82c79c20ce4d98231492ba7dea42be95c2 100644 --- a/docs/includes/apiargs-common-param.yaml +++ b/docs/includes/apiargs-common-param.yaml @@ -7,7 +7,6 @@ description: | interface: phpmethod operation: ~ optional: false -position: 1 --- arg_name: param name: $databaseName @@ -19,7 +18,6 @@ operation: ~ optional: false replacement: action: "" -position: 1 --- arg_name: param name: $collectionName @@ -31,7 +29,6 @@ operation: ~ optional: false replacement: action: "" -position: 2 --- arg_name: param name: $options @@ -41,17 +38,4 @@ description: | interface: phpmethod operation: ~ optional: true -position: 3 ---- -arg_name: param -name: $filter -type: array|object -description: | - The filter criteria that specifies the documents to {{verb}}. -interface: phpmethod -operation: ~ -optional: false -position: 4 -replacement: - verb: "count" ... diff --git a/docs/reference/method/MongoDBCollection-createIndex.txt b/docs/reference/method/MongoDBCollection-createIndex.txt index fb5d17810ccdc5940293be4e3528ac977304f7c2..3b9b3d9636da23ec7754400d5d743647d1c43026 100644 --- a/docs/reference/method/MongoDBCollection-createIndex.txt +++ b/docs/reference/method/MongoDBCollection-createIndex.txt @@ -26,7 +26,7 @@ Definition .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst The ``$options`` parameter accepts all index options that your MongoDB - version supports. MongoDB 3.2 includes the following options: + version supports. MongoDB includes the following options: .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst diff --git a/docs/reference/method/MongoDBCollection-createIndexes.txt b/docs/reference/method/MongoDBCollection-createIndexes.txt index 0d25e7d139597ab30098b69986d4c70cf26a49ad..9c9e1477d00615d38de3e7ed762202316354103e 100644 --- a/docs/reference/method/MongoDBCollection-createIndexes.txt +++ b/docs/reference/method/MongoDBCollection-createIndexes.txt @@ -19,37 +19,40 @@ Definition .. code-block:: php - function createIndexes(array $indexes): string[] + function createIndexes(array $indexes, array $options = []): string[] - ``createIndex()`` has one parameter, ``$indexes``, which is an array. Each - element in ``$indexes`` must itself be an array that specifies an index. The - specification array requires a ``key`` field, which corresponds to the - ``$key`` parameter of :phpmethod:`MongoDB\\Collection::createIndex()`, and - may have other fields that correspond to options of - :phpmethod:`MongoDB\\Collection::createIndex()`. + :phpmethod:`MongoDB\\Collection::createIndexes()` has the following + parameters: - For example, the following ``$indexes`` parameter creates two indexes. The - first is an ascending unique index on the ``username`` field and the second - is a 2dsphere index on the ``loc`` field with a custom name:: + .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst - [ - [ 'key' => [ 'username' => 1 ], 'unique' => true ], - [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ], - ] + The ``$options`` parameter supports the following options: - You can specify any index options that your MongoDB version - supports. MongoDB 3.2 includes the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst - - For a full list of the supported index creation options, refer to the - :manual:`createIndexes </reference/command/createIndexes>` command reference - in the MongoDB manual. + .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst :returns: The names of the created indexes as an array of strings. +``$indexes`` parameter +---------------------- + +The ``$indexes`` parameter is an array of index specification documents. Each +element in ``$indexes`` must itself be an array or object with a ``key`` field, +which corresponds to the ``$key`` parameter of :phpmethod:`createIndex() +<MongoDB\\Collection::createIndex()>`. The array or object may include other +fields that correspond to index options accepted by :phpmethod:`createIndex() +<MongoDB\\Collection::createIndex()>` (excluding ``writeConcern``). + +For example, the following ``$indexes`` parameter creates two indexes. The first +is an ascending unique index on the ``username`` field and the second is a +2dsphere index on the ``loc`` field with a custom name:: + + [ + [ 'key' => [ 'username' => 1 ], 'unique' => true ], + [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ], + ] + Example -------