Commit 9a53ec6a authored by Jeremy Mikola's avatar Jeremy Mikola

Refactor option/param includes and document MongoDB 3.4 features

parent 12f583d9
...@@ -4,9 +4,8 @@ type: array ...@@ -4,9 +4,8 @@ type: array
description: | description: |
Default :php:`type map Default :php:`type map
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`
to apply to cursors. The type map determines how BSON documents are converted to apply to cursors, which determines how BSON documents are converted to PHP
to PHP values which determines. The |php-library| uses the following type map values. The |php-library| uses the following type map by default:
by default:
.. code-block:: php .. code-block:: php
...@@ -16,7 +15,6 @@ description: | ...@@ -16,7 +15,6 @@ description: |
'root' => 'MongoDB\Model\BSONDocument', 'root' => 'MongoDB\Model\BSONDocument',
] ]
interface: phpmethod interface: phpmethod
operation: MongoDB\\Client::__construct operation: ~
optional: true optional: true
position: 1
... ...
...@@ -6,11 +6,10 @@ description: | ...@@ -6,11 +6,10 @@ description: |
connect. Refer to the :manual:`MongoDB connection string reference connect. Refer to the :manual:`MongoDB connection string reference
</reference/connection-string>` for formatting. </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 interface: phpmethod
operation: MongoDB\\Client::__construct operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: param arg_name: param
name: $uriOptions name: $uriOptions
...@@ -19,15 +18,14 @@ description: | ...@@ -19,15 +18,14 @@ description: |
Specifies additional URI options, such as authentication credentials or query Specifies additional URI options, such as authentication credentials or query
string parameters. The options specified in ``$uriOptions`` take precedence string parameters. The options specified in ``$uriOptions`` take precedence
over any analogous options present in the ``$uri`` string. over any analogous options present in the ``$uri`` string.
post: |
Refer to the :php:`MongoDB\\Driver\\Manager::__construct() Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
<mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB <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. options.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Client::__construct operation: ~
optional: true optional: true
position: 2
--- ---
arg_name: param arg_name: param
name: $driverOptions name: $driverOptions
...@@ -39,7 +37,6 @@ description: | ...@@ -39,7 +37,6 @@ description: |
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`
to apply to the cursors it creates. to apply to the cursors it creates.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Client::__construct operation: ~
optional: true optional: true
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: typeMap 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: | description: |
Type map for BSON deserialization. This will be used for the returned command :manual:`Write concern </reference/write-concern>` to use for the operation.
result document. Defaults to the clients's type map. 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
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Client::dropDatabase
position: 1
replacement: replacement:
action: " to drop" action: " to drop"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Client::dropDatabase
position: 2
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Client::__get
position: 1
replacement: replacement:
action: " to select" action: " to select"
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Client::listDatabases
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Client::listDatabases
position: 1
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Client::selectCollection
position: 1
replacement: replacement:
action: " containing the collection to select" action: " containing the collection to select"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Client::selectCollection
position: 2
replacement: replacement:
action: " to select" action: " to select"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Client::selectCollection
position: 3
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Client::selectDatabase
position: 1
replacement: replacement:
action: " to select" action: " to select"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Client::selectDatabase
position: 2
... ...
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
...
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
...
...@@ -3,68 +3,59 @@ name: allowDiskUse ...@@ -3,68 +3,59 @@ name: allowDiskUse
type: boolean type: boolean
description: | description: |
Enables writing to temporary files. When set to ``true``, aggregation stages Enables writing to temporary files. When set to ``true``, aggregation stages
can write data to the ``_tmp`` sub-directory in the dbPath directory. can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The
The default is ``false``. default is ``false``.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::aggregate operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: option arg_name: option
name: batchSize name: batchSize
type: integer type: integer
description: | 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 interface: phpmethod
operation: MongoDB\\Collection::aggregate operation: ~
optional: true optional: true
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::aggregate post: |
position: 3 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: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::aggregate
position: 4
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Collection::aggregate
position: 5
replacement:
resource: "aggregation"
parent: "collection"
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Collection::aggregate
position: 6
replacement:
resource: "aggregation"
parent: "collection"
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::aggregate post: |
position: 7
description: |
Type map for BSON deserialization. This will be applied to the returned
cursor. Defaults to the collections's type map.
.. note:: .. note::
This is not supported for inline aggregation results (i.e. ``useCursor`` This is not supported for inline aggregation results (i.e. ``useCursor``
option is ``false`` or the server version is < 2.6). option is ``false`` or the server version is < 2.6).
--- ---
arg_name: param arg_name: option
name: useCursor name: useCursor
type: boolean type: boolean
description: | description: |
...@@ -77,7 +68,15 @@ description: | ...@@ -77,7 +68,15 @@ description: |
``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation
cursors are not available. cursors are not available.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::aggregate operation: ~
optional: true 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.
... ...
...@@ -5,12 +5,10 @@ description: | ...@@ -5,12 +5,10 @@ description: |
Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>` Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>`
operation. operation.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::aggregate operation: ~
position: 1 optional: false
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::aggregate
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::bulkWrite
position: 1
--- ---
arg_name: option arg_name: option
name: ordered name: ordered
...@@ -16,16 +14,10 @@ description: | ...@@ -16,16 +14,10 @@ description: |
The default is ``true``. The default is ``true``.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::bulkWrite operation: ~
optional: true optional: true
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::bulkWrite
replacement:
resource: "write"
parent: "collection"
position: 3
... ...
...@@ -22,20 +22,16 @@ description: | ...@@ -22,20 +22,16 @@ description: |
[ 'updateMany' => [ $filter, $update, $options ] ], [ 'updateMany' => [ $filter, $update, $options ] ],
[ 'updateOne' => [ $filter, $update, $options ] ], [ 'updateOne' => [ $filter, $update, $options ] ],
] ]
post: |
Arguments correspond to the respective operation methods. However, the Arguments correspond to the respective operation methods. However, the
``writeConcern`` option is specified as a top-level option to ``writeConcern`` option is specified as a top-level option to
:phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
operation. operation.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::bulkWrite operation: ~
optional: true optional: true
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::bulkWrite
interface: phpmethod
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Collection::__construct
position: 1
replacement: replacement:
resource: "collection" resource: "collection"
parent: "manager" parent: "manager"
...@@ -10,39 +8,17 @@ replacement: ...@@ -10,39 +8,17 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Collection::__construct
position: 2
replacement: replacement:
resource: "collection" resource: "collection"
parent: "manager" parent: "manager"
--- ---
arg_name: option source:
name: typeMap file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
type: array ref: typeMap
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: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::__construct
position: 4
replacement: replacement:
resource: "collection" resource: "collection"
parent: "manager" parent: "manager"
......
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $manager ref: $manager
operation: MongoDB\\Collection::__construct
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Collection::__construct
position: 2
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Collection::__construct
position: 3
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::__construct
position: 4
... ...
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
---
arg_name: option arg_name: option
name: hint name: hint
type: string|array|object type: string|array|object
description: | description: |
The index to use. If you specify a document, it is interpreted as an index 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 interface: phpmethod
operation: MongoDB\\Collection::count operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: option arg_name: option
name: limit name: limit
type: integer type: integer
description: | description: |
The maximum number of documents to return. The maximum number of matching documents to return.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::count operation: ~
optional: true optional: true
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::count
position: 3
--- ---
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: readConcern ref: readConcern
file: apiargs-common-option.yaml
operation: MongoDB\\Collection::count
replacement:
resource: "count"
parent: "collection"
position: 4
--- ---
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: readPreference ref: readPreference
file: apiargs-common-option.yaml
replacement:
resource: "count"
parent: "collection"
position: 5
--- ---
arg_name: option arg_name: option
name: skip name: skip
type: integer type: integer
description: | description: |
The number of documents to skip before returning the documents. The number of matching documents to skip before returning results.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::count operation: ~
optional: true optional: true
position: 6
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
operation: MongoDB\\Collection::count optional: true
position: 1 replacement:
action: " to count"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::count
position: 2
... ...
...@@ -4,9 +4,15 @@ type: boolean ...@@ -4,9 +4,15 @@ type: boolean
description: | description: |
Creates a :manual:`unique </core/index-unique>` index. Creates a :manual:`unique </core/index-unique>` index.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true 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 arg_name: option
name: partialFilterExpression name: partialFilterExpression
...@@ -14,9 +20,8 @@ type: array|object ...@@ -14,9 +20,8 @@ type: array|object
description: | description: |
Creates a :manual:`partial </core/index-partial>` index. Creates a :manual:`partial </core/index-partial>` index.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 2
--- ---
arg_name: option arg_name: option
name: sparse name: sparse
...@@ -24,9 +29,8 @@ type: boolean ...@@ -24,9 +29,8 @@ type: boolean
description: | description: |
Creates a :manual:`sparse </core/index-sparse>` index. Creates a :manual:`sparse </core/index-sparse>` index.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 3
--- ---
arg_name: option arg_name: option
name: expireAfterSeconds name: expireAfterSeconds
...@@ -34,20 +38,18 @@ type: integer ...@@ -34,20 +38,18 @@ type: integer
description: | description: |
Creates a :manual:`TTL </core/index-ttl>` index. Creates a :manual:`TTL </core/index-ttl>` index.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 4
--- ---
arg_name: option arg_name: option
name: name name: name
type: string type: string
description: | description: |
Specifies the name for the index. By default, MongoDB creates index names A name that uniquely identifies the index. By default, MongoDB creates index
based on the key. names based on the key.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 5
--- ---
arg_name: option arg_name: option
name: background name: background
...@@ -56,9 +58,8 @@ description: | ...@@ -56,9 +58,8 @@ description: |
Instructs MongoDB to build the index :manual:`as a background Instructs MongoDB to build the index :manual:`as a background
</core/index-creation>` process. </core/index-creation>` process.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 6
--- ---
arg_name: option arg_name: option
name: 2dsphereIndexVersion name: 2dsphereIndexVersion
...@@ -69,15 +70,15 @@ description: | ...@@ -69,15 +70,15 @@ description: |
MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default 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. 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 interface: phpmethod
operation: MongoDB\\Collection::createIndex operation: ~
optional: true optional: true
position: 7
--- ---
source: source:
ref: maxTimeMS file: apiargs-MongoDBCollection-common-option.yaml
file: apiargs-common-option.yaml ref: writeConcern
operation: MongoDB\\Collection::createIndex post: |
position: 8 This is not supported for server versions prior to 3.4 and will result in an
exception at execution time if used.
... ...
...@@ -10,14 +10,11 @@ description: | ...@@ -10,14 +10,11 @@ description: |
.. code-block:: php .. code-block:: php
[ 'username' => -1 ] [ 'username' => -1 ]
operation: MongoDB\\Collection::createIndex
interface: phpmethod interface: phpmethod
operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::createIndex
position: 2
... ...
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.
...
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
...
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
file: apiargs-common-option.yaml
operation: MongoDB\\Collection::deleteMany
replacement:
resource: "delete"
position: 1
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml optional: false
operation: MongoDB\\Collection::deleteMany
replacement: replacement:
verb: "delete" action: " to delete"
position: 1
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::deleteMany ref: $options
position: 2
... ...
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
file: apiargs-common-option.yaml
operation: MongoDB\\Collection::deleteOne
replacement:
resource: "delete"
position: 1
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml optional: false
operation: MongoDB\\Collection::deleteOne
replacement: replacement:
verb: "delete" action: " to delete"
position: 1
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::deleteOne ref: $options
position: 2
... ...
source: source:
ref: maxTimeMS file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
---
source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
operation: MongoDB\\Collection::distinct ref: maxTimeMS
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: readConcern ref: readConcern
file: apiargs-common-option.yaml
operation: MongoDB\\Collection::distinct
replacement:
resource: "distinct"
position: 2
--- ---
source: source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: readPreference ref: readPreference
file: apiargs-common-option.yaml
replacement:
resource: "distinct"
position: 3
... ...
...@@ -4,19 +4,17 @@ type: string ...@@ -4,19 +4,17 @@ type: string
description: | description: |
The field for which to return distinct values. The field for which to return distinct values.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::distinct operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
position: 2
optional: true optional: true
replacement:
action: " from which to retrieve the distinct values"
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::count ref: $options
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::drop post: |
position: 1 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.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
interface: phpmethod
operation: MongoDB\\Collection::drop
position: 1
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::dropIndex post: |
position: 1 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.
... ...
...@@ -2,18 +2,14 @@ arg_name: param ...@@ -2,18 +2,14 @@ arg_name: param
name: $indexName name: $indexName
type: string type: string
description: | description: |
The name of the index to drop. View the existing indexes on the The name of the index to drop. View the existing indexes on the collection
collection using the :phpmethod:`listIndexes using the :phpmethod:`listIndexes() <MongoDB\\Collection::listIndexes>`
<MongoDB\\Collection::listIndexes>` method. method.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::dropIndex operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
interface: phpmethod
operation: MongoDB\\Collection::dropIndex
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::dropIndexes post: |
position: 1 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.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::dropIndexes
position: 1
... ...
name: sort arg_name: option
name: projection
type: array|object type: array|object
optional: true
description: | description: |
The sort specification for the ordering of the results. The :ref:`projection specification <projections>` to determine which fields to
arg_name: field include in the returned documents. See :manual:`Project Fields to Return from
operation: MongoDB\\Collection::find Query </tutorial/project-fields-from-query-results>` and
:manual:`Projection Operators </reference/operator/projection>` in the MongoDB
manual.
interface: phpmethod interface: phpmethod
position: 2 operation: ~
optional: true
--- ---
name: projection arg_name: option
name: sort
type: array|object type: array|object
optional: true
description: | description: |
The :ref:`projection specification <projections>` to determine The sort specification for the ordering of the results.
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
interface: phpmethod interface: phpmethod
position: 1 operation: ~
optional: true
--- ---
arg_name: option
name: skip name: skip
type: integer type: integer
optional: true
description: | description: |
Number of documents to skip. Defaults to 0. Number of documents to skip. Defaults to ``0``.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 3 operation: ~
optional: true
--- ---
arg_name: option
name: limit name: limit
type: integer type: integer
optional: true
description: | description: |
The maximum number of documents to return. If unspecified, The maximum number of documents to return. If unspecified, then defaults to no
then defaults to no limit. A limit of 0 is equivalent to setting no limit. A limit of ``0`` is equivalent to setting no limit.
limit.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 4 operation: ~
optional: true
--- ---
arg_name: option
name: batchSize name: batchSize
type: integer type: integer
optional: true
description: | description: |
The number of documents to return in the first batch. The number of documents to return in the first batch. Defaults to ``101``. A
Defaults to 101. A batchSize of 0 means that the cursor will be batchSize of ``0`` means that the cursor will be established, but no documents
established, but no documents will be returned in the first batch. will be returned in the first batch.
Unlike the previous wire protocol version, a batchSize of 1 for Unlike the previous wire protocol version, a batchSize of ``1`` for the
the :dbcommand:`find` command does not close the cursor. :dbcommand:`find` command does not close the cursor.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 5 operation: ~
optional: true
--- ---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
---
arg_name: option
name: comment name: comment
type: string type: string
optional: true
description: | description: |
A comment to attach to the query to help interpret and trace query A comment to attach to the query to help interpret and trace query
:dbcommand:`profile` data. :dbcommand:`profile` data.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 6 operation: ~
optional: true
--- ---
arg_name: option arg_name: option
name: cursorType name: cursorType
...@@ -80,87 +77,70 @@ description: | ...@@ -80,87 +77,70 @@ description: |
- ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*) - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
- ``MongoDB\Operation\Find::TAILABLE`` - ``MongoDB\Operation\Find::TAILABLE``
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::find operation: ~
optional: true optional: true
position: 7
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::find
position: 8
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Collection::find
position: 9
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readPreference ref: readPreference
pre: |
For use with MongoDB 3.0 and earlier.
operation: MongoDB\\Collection::find
position: 10
--- ---
arg_name: option
name: oplogReplay name: oplogReplay
type: boolean type: boolean
optional: true
description: | description: |
Internal use for replica sets. To use oplogReplay, you must include Internal use for replica sets. To use ``oplogReplay``, you must include the
the following condition in the filter: 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>` The :php:`MongoDB\\BSON\\Timestamp <class.mongodb-bson-timestamp>` class
class reference describes how to represent MongoDB's BSON reference describes how to represent MongoDB's BSON timestamp type with PHP.
timestamp type with PHP.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 11 operation: ~
optional: true
--- ---
arg_name: option
name: noCursorTimeout name: noCursorTimeout
type: boolean type: boolean
optional: true
description: | description: |
Prevents the server from timing out idle cursors after an inactivity Prevents the server from timing out idle cursors after an inactivity period
period (10 minutes). (10 minutes).
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 12 operation: ~
optional: true
--- ---
arg_name: option
name: allowPartialResults name: allowPartialResults
type: boolean type: boolean
optional: true
description: | description: |
For queries against a sharded collection, returns partial results from For queries against a sharded collection, returns partial results from the
the :program:`mongos` if some shards are unavailable instead of :program:`mongos` if some shards are unavailable instead of throwing an error.
throwing an error.
arg_name: field
operation: MongoDB\\Collection::find
interface: phpmethod interface: phpmethod
position: 13 operation: ~
optional: true
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::find
position: 14
--- ---
arg_name: option arg_name: option
name: modifiers name: modifiers
type: array type: array|object
description: | description: |
Meta-operators that modify the output or behavior of a query. Meta-operators that modify the output or behavior of a query. :manual:`Cursor
:manual:`Cursor Methods </reference/method/js-cursor`> describes the Methods </reference/method/js-cursor`> describes the query modification
query modification methods available in MongoDB. methods available in MongoDB.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::find operation: ~
optional: true optional: true
position: 15
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml optional: true
operation: MongoDB\\Collection::find
replacement: replacement:
verb: "query" action: " to query"
position: 1
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::find ref: $options
position: 2
... ...
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: projection ref: projection
operation: MongoDB\\Collection::findOne
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: sort ref: sort
operation: MongoDB\\Collection::findOne
position: 2
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: skip ref: skip
operation: MongoDB\\Collection::findOne
position: 3
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: comment ref: collation
operation: MongoDB\\Collection::findOne
position: 4
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: modifiers ref: comment
operation: MongoDB\\Collection::findOne
position: 5
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::findOne
position: 6
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Collection::findOne
position: 7
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: readPreference ref: readPreference
pre: |
For use with MongoDB 3.0 and earlier.
operation: MongoDB\\Collection::findOne
position: 8
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::findOne post: |
position: 9 This will be used for the returned result document.
---
source:
file: apiargs-MongoDBCollection-method-find-option.yaml
ref: modifiers
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml optional: true
operation: MongoDB\\Collection::findOne
replacement: replacement:
verb: "query" action: " to query"
position: 1
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOne ref: $options
position: 2
... ...
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: projection ref: projection
operation: MongoDB\\Collection::findOneAndDelete
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: sort ref: sort
operation: MongoDB\\Collection::findOneAndDelete ---
position: 2 source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::findOneAndDelete
position: 3
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::findOneAndDelete post: |
position: 4 This is not supported for server versions prior to 3.2 and will be ignored if
used.
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml optional: false
operation: MongoDB\\Collection::findOneAndDelete
replacement: replacement:
verb: "query" action: " to delete"
position: 1
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOneAndDelete ref: $options
position: 2
... ...
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: projection ref: projection
operation: MongoDB\\Collection::findOneAndReplace
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: sort ref: sort
operation: MongoDB\\Collection::findOneAndReplace ---
position: 2 source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Collection::findOneAndReplace
position: 3
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::findOneAndReplace
position: 4
--- ---
arg_name: option arg_name: option
name: returnDocument name: returnDocument
type: integer type: integer
description: | 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: after. ``returnDocument`` supports the following values:
- ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*) - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
- ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`` - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
interface: phpmethod interface: phpmethod
operation: MongoDB\Collection::findOneAndUpdate operation: ~
optional: true optional: true
position: 5
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert ref: upsert
operation: MongoDB\\Collection::findOneAndReplace
position: 6
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::findOneAndReplace post: |
position: 7 This is not supported for server versions prior to 3.2 and will be ignored if
used.
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOneAndReplace
replacement:
verb: "query"
optional: false optional: false
position: 1 replacement:
action: " to replace"
--- ---
arg_name: param source:
name: $replacement file: apiargs-MongoDBCollection-common-param.yaml
type: array|object ref: $replacement
description: |
The document to replace.
interface: phpmethod
operation: MongoDB\\Collection::findOneAndReplace
optional: false
position: 2
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOneAndReplace ref: $options
position: 3
... ...
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: projection ref: projection
operation: MongoDB\Collection::findOneAndUpdate
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-method-find-option.yaml file: apiargs-MongoDBCollection-method-find-option.yaml
ref: sort ref: sort
operation: MongoDB\Collection::findOneAndUpdate ---
position: 2 source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: collation
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\Collection::findOneAndUpdate
position: 3
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\Collection::findOneAndUpdate
position: 4
--- ---
arg_name: option arg_name: option
name: returnDocument name: returnDocument
...@@ -32,19 +28,17 @@ description: | ...@@ -32,19 +28,17 @@ description: |
- ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*) - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
- ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER`` - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
interface: phpmethod interface: phpmethod
operation: MongoDB\Collection::findOneAndUpdate operation: ~
optional: true optional: true
position: 5
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert ref: upsert
operation: MongoDB\\Collection::findOneAndUpdate
position: 6
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\Collection::findOneAndUpdate post: |
position: 7 This is not supported for server versions prior to 3.2 and will be ignored if
used.
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOneAndUpdate
replacement:
verb: "query"
optional: false optional: false
position: 1 replacement:
action: " to update"
--- ---
arg_name: param source:
name: $update file: apiargs-MongoDBCollection-common-param.yaml
type: array|object ref: $update
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: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::findOneAndUpdate ref: $options
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::insertMany
position: 1
--- ---
source: source:
file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
ref: ordered ref: ordered
operation: MongoDB\\Collection::insertMany
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::insertMany
position: 3
... ...
...@@ -4,13 +4,10 @@ type: array ...@@ -4,13 +4,10 @@ type: array
description: | description: |
The documents to insert into the collection. The documents to insert into the collection.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::insertMany operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::insertMany
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::insertOne
position: 1
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::insertOne
position: 2
... ...
...@@ -4,13 +4,10 @@ type: array|object ...@@ -4,13 +4,10 @@ type: array|object
description: | description: |
The document to insert into the collection. The document to insert into the collection.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Collection::insertOne operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::insertOne
position: 2
... ...
source: source:
ref: maxTimeMS
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
operation: MongoDB\\Collection::listIndexes ref: maxTimeMS
position: 1
... ...
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::listIndexes ref: $options
position: 1
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert
---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::replaceOne
position: 1
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert ref: collation
operation: MongoDB\\Collection::replaceOne
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::replaceOne
position: 3
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml
operation: MongoDB\\Collection::replaceOne
replacement:
verb: "query"
optional: false optional: false
position: 1 replacement:
action: " to replace"
--- ---
arg_name: param source:
name: $replacement file: apiargs-MongoDBCollection-common-param.yaml
type: array ref: $replacement
description: |
The document to replace.
interface: phpmethod
operation: MongoDB\\Collection::replaceOne
optional: false
position: 2
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::replaceOne ref: $options
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert
---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::updateMany
position: 1
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert ref: collation
operation: MongoDB\\Collection::updateMany
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::updateMany
position: 3
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml
operation: MongoDB\\Collection::updateMany
replacement:
verb: "query"
optional: false optional: false
position: 1 replacement:
action: " to update"
--- ---
source: source:
file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml file: apiargs-MongoDBCollection-common-param.yaml
ref: $update ref: $update
operation: MongoDB\\Collection::updateMany
optional: false
position: 2
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::updateMany ref: $options
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert
---
source:
file: apiargs-MongoDBCollection-common-option.yaml
ref: bypassDocumentValidation ref: bypassDocumentValidation
operation: MongoDB\\Collection::updateOne
position: 1
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: upsert ref: collation
operation: MongoDB\\Collection::updateOne
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBCollection-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::updateOne
position: 3
... ...
source: source:
file: apiargs-MongoDBCollection-common-param.yaml
ref: $filter ref: $filter
file: apiargs-common-param.yaml
operation: MongoDB\\Collection::updateOne
replacement:
verb: "query"
optional: false optional: false
position: 1 replacement:
action: " to update"
--- ---
source: source:
file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml file: apiargs-MongoDBCollection-common-param.yaml
ref: $update ref: $update
operation: MongoDB\\Collection::updateOne
optional: false
position: 2
--- ---
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::updateOne ref: $options
position: 3
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Collection::withOptions replacement:
description: | resource: "collection"
The default read concern to use for collection operations. Defaults parent: "original collection"
to the original Collection's specified read concern.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Collection::withOptions replacement:
description: | resource: "collection"
The default read preference to use for collection operations. parent: "original collection"
Defaults to the original Collection's read preference.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Collection::withOptions replacement:
description: | parent: "original collection"
Default type map for cursors and BSON documents. Defaults to the
original Collection's type map value.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Collection::withOptions replacement:
description: | resource: "collection"
The default write concern to use for collection operations. Defaults parent: "original collection"
to the original Collection's specified write concern.
... ...
source: source:
ref: $options
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
operation: MongoDB\\Collection::withOptions ref: $options
position: 1
... ...
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
...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Database::command
position: 1
description: | description: |
The read preference to use when executing the command. This may be used when :manual:`Read preference </reference/read-preference>` to use for the
issuing the command to a replica set or shard cluster to ensure that the operation. Defaults to the database's read preference.
driver sets the wire protocol accordingly or adds the read preference to the
command document, respectively. Defaults to the Database's read preference.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBDatabase-common-option.yaml
ref: typeMap 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.
... ...
...@@ -4,13 +4,10 @@ type: array|object ...@@ -4,13 +4,10 @@ type: array|object
description: | description: |
The :manual:`database command </reference/command>` document. The :manual:`database command </reference/command>` document.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::command operation: ~
optional: false optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::command
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Database::__construct
position: 1
replacement: replacement:
resource: "database" resource: "database"
parent: "manager" parent: "manager"
...@@ -10,39 +8,17 @@ replacement: ...@@ -10,39 +8,17 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Database::__construct
position: 2
replacement: replacement:
resource: "database" resource: "database"
parent: "manager" parent: "manager"
--- ---
arg_name: option source:
name: typeMap file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
type: array ref: typeMap
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: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Database::__construct
position: 4
replacement: replacement:
resource: "database" resource: "database"
parent: "manager" parent: "manager"
......
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $manager ref: $manager
operation: MongoDB\\Database::__construct
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\Database::__construct
position: 2
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Collection::__construct
position: 3
... ...
...@@ -11,9 +11,8 @@ description: | ...@@ -11,9 +11,8 @@ description: |
.. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4. .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: option arg_name: option
name: capped name: capped
...@@ -22,9 +21,15 @@ description: | ...@@ -22,9 +21,15 @@ description: |
To create a capped collection, specify ``true``. If you specify ``true``, you To create a capped collection, specify ``true``. If you specify ``true``, you
must also set a maximum size in the ``size`` option. must also set a maximum size in the ``size`` option.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true 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 arg_name: option
name: flags name: flags
...@@ -48,9 +53,8 @@ description: | ...@@ -48,9 +53,8 @@ description: |
:manual:`db.createCollection() :manual:`db.createCollection()
</reference/method/db.createCollection>` for more information. </reference/method/db.createCollection>` for more information.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 4
--- ---
arg_name: option arg_name: option
name: indexOptionDefaults name: indexOptionDefaults
...@@ -68,31 +72,26 @@ description: | ...@@ -68,31 +72,26 @@ description: |
and logged to the :term:`oplog` during replication to support replica sets and logged to the :term:`oplog` during replication to support replica sets
with members that use different storage engines. with members that use different storage engines.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 5
--- ---
arg_name: option arg_name: option
name: max name: max
type: integer type: integer
description: | description: |
The maximum number of documents allowed in the capped collection. The The maximum number of documents allowed in the capped collection. The ``size``
``size`` option takes precedence over this limit. If a capped option takes precedence over this limit. If a capped collection reaches the
collection reaches the ``size`` limit before it reaches the maximum ``size`` limit before it reaches the maximum number of documents, MongoDB
number of documents, MongoDB removes old documents. If you prefer to removes old documents. If you prefer to use the ``max`` limit, ensure that the
use the ``max`` limit, ensure that the ``size`` limit, which is ``size`` limit, which is required for a capped collection, is sufficient to
required for a capped collection, is sufficient to contain the contain the maximum number of documents.
maximum number of documents.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 6
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Database::createCollection
position: 7
--- ---
arg_name: option arg_name: option
name: size name: size
...@@ -103,9 +102,8 @@ description: | ...@@ -103,9 +102,8 @@ description: |
make space for the new documents. The ``size`` option is required for capped make space for the new documents. The ``size`` option is required for capped
collections and ignored for other collections. collections and ignored for other collections.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 8
--- ---
arg_name: option arg_name: option
name: storageEngine name: storageEngine
...@@ -123,18 +121,14 @@ description: | ...@@ -123,18 +121,14 @@ description: |
validated and logged to the :term:`oplog` during replication to support validated and logged to the :term:`oplog` during replication to support
replica sets with members that use different storage engines. replica sets with members that use different storage engines.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 9
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBDatabase-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Database::createCollection post: |
position: 10 This will be used for the returned command result document.
description: |
Type map for BSON deserialization. This will be used for the returned command
result document. Defaults to the database's type map.
--- ---
arg_name: option arg_name: option
name: validator name: validator
...@@ -160,10 +154,9 @@ description: | ...@@ -160,10 +154,9 @@ description: |
``local``, and ``config`` databases. ``local``, and ``config`` databases.
- You cannot specify a validator for ``system.*`` collections. - You cannot specify a validator for ``system.*`` collections.
operation: MongoDB\\Database::createCollection operation: ~
interface: phpmethod interface: phpmethod
optional: true optional: true
position: 11
--- ---
arg_name: option arg_name: option
name: validationAction name: validationAction
...@@ -194,9 +187,8 @@ description: | ...@@ -194,9 +187,8 @@ description: |
- Documents do not have to pass validation. If the document fails - Documents do not have to pass validation. If the document fails
validation, the write operation logs the validation failure. validation, the write operation logs the validation failure.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true optional: true
position: 12
--- ---
arg_name: option arg_name: option
name: validationLevel name: validationLevel
...@@ -226,7 +218,13 @@ description: | ...@@ -226,7 +218,13 @@ description: |
documents. Do not apply rules to updates on existing *invalid* documents. Do not apply rules to updates on existing *invalid*
documents. documents.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::createCollection operation: ~
optional: true 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.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Database::createCollection
position: 1
replacement: replacement:
action: " to create" action: " to create"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::createCollection
position: 2
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBDatabase-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Database::drop post: |
position: 1 This will be used for the returned command result document.
description: | ---
Type map for BSON deserialization. This will be used for the returned command source:
result document. Defaults to the database's type map. 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.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::drop
position: 1
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-MongoDBDatabase-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Database::dropCollection post: |
position: 1 This will be used for the returned command result document.
description: | ---
Type map for BSON deserialization. This will be used for the returned command source:
result document. Defaults to the database's type map. 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.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Database::dropCollection
position: 1
replacement: replacement:
action: " to drop" action: " to drop"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::dropCollection
position: 2
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Database::__get
position: 1
replacement: replacement:
action: " to select" action: " to select"
... ...
...@@ -2,15 +2,14 @@ arg_name: option ...@@ -2,15 +2,14 @@ arg_name: option
name: filter name: filter
type: array|object type: array|object
description: | 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 interface: phpmethod
operation: MongoDB\\Database::listCollections operation: ~
optional: true optional: true
position: 1
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: maxTimeMS ref: maxTimeMS
operation: MongoDB\\Database::listCollections
position: 2
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::listCollections
position: 1
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Database::selectCollection
position: 1
replacement: replacement:
resource: "collection" resource: "collection"
parent: "database" parent: "database"
...@@ -10,8 +8,6 @@ replacement: ...@@ -10,8 +8,6 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Database::selectCollection
position: 2
replacement: replacement:
resource: "collection" resource: "collection"
parent: "database" parent: "database"
...@@ -19,16 +15,12 @@ replacement: ...@@ -19,16 +15,12 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Database::selectCollection
position: 3
replacement: replacement:
parent: "database" parent: "database"
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Database::selectCollection
position: 4
replacement: replacement:
resource: "collection" resource: "collection"
parent: "database" parent: "database"
......
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $collectionName ref: $collectionName
operation: MongoDB\\Database::selectCollection
position: 1
replacement: replacement:
action: " to select" action: " to select"
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::selectCollection
position: 2
... ...
...@@ -5,9 +5,8 @@ description: | ...@@ -5,9 +5,8 @@ description: |
The bucket name, which will be used as a prefix for the files and chunks The bucket name, which will be used as a prefix for the files and chunks
collections. Defaults to ``"fs"``. collections. Defaults to ``"fs"``.
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::selectGridFSBucket operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: option arg_name: option
name: chunkSizeBytes name: chunkSizeBytes
...@@ -15,15 +14,12 @@ type: integer ...@@ -15,15 +14,12 @@ type: integer
description: | description: |
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
interface: phpmethod interface: phpmethod
operation: MongoDB\\Database::selectGridFSBucket operation: ~
optional: true optional: true
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Database::selectGridFSBucket
position: 3
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
...@@ -31,8 +27,6 @@ replacement: ...@@ -31,8 +27,6 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Database::selectGridFSBucket
position: 4
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
...@@ -40,8 +34,6 @@ replacement: ...@@ -40,8 +34,6 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Database::selectGridFSBucket
position: 5
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
......
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::selectGridFSBucket
position: 1
... ...
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\Database::withOptions replacement:
description: | resource: "database"
The default read concern to use for database operations. Defaults to the parent: "original database"
original Databases's read concern.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\Database::withOptions replacement:
description: | resource: "database"
The default read preference to use for database operations. Defaults to the parent: "original database"
original Database's read preference.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: typeMap ref: typeMap
operation: MongoDB\\Database::withOptions replacement:
description: | parent: "original database"
Default type map to use for converting BSON. Defaults to the original
Database's type map.
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\Database::withOptions replacement:
description: | resource: "database"
The default write concern to use for database operations. Defaults to the parent: "original database"
original Database's write concern.
... ...
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\Database::withOptions
position: 1
... ...
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
...
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
...
...@@ -5,9 +5,8 @@ description: | ...@@ -5,9 +5,8 @@ description: |
The bucket name, which will be used as a prefix for the files and chunks The bucket name, which will be used as a prefix for the files and chunks
collections. Defaults to ``"fs"``. collections. Defaults to ``"fs"``.
interface: phpmethod interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::__construct operation: ~
optional: true optional: true
position: 1
--- ---
arg_name: option arg_name: option
name: chunkSizeBytes name: chunkSizeBytes
...@@ -15,15 +14,12 @@ type: integer ...@@ -15,15 +14,12 @@ type: integer
description: | description: |
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
interface: phpmethod interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::__construct operation: ~
optional: true optional: true
position: 2
--- ---
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readConcern ref: readConcern
operation: MongoDB\\GridFS\\Bucket::__construct
position: 3
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
...@@ -31,8 +27,6 @@ replacement: ...@@ -31,8 +27,6 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: readPreference ref: readPreference
operation: MongoDB\\GridFS\\Bucket::__construct
position: 4
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
...@@ -40,8 +34,6 @@ replacement: ...@@ -40,8 +34,6 @@ replacement:
source: source:
file: apiargs-common-option.yaml file: apiargs-common-option.yaml
ref: writeConcern ref: writeConcern
operation: MongoDB\\GridFS\\Bucket::__construct
position: 5
replacement: replacement:
resource: "bucket" resource: "bucket"
parent: "database" parent: "database"
......
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $manager ref: $manager
operation: MongoDB\\GridFS\\Bucket::__construct
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $databaseName ref: $databaseName
operation: MongoDB\\GridFS\\Bucket::__construct
position: 2
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\GridFS\\Bucket::__construct
position: 3
... ...
arg_name: param source:
name: $id file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: mixed ref: $id
description: | replacement:
The ``_id`` of the file to delete. resource: " to delete"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::delete
optional: false
position: 1
... ...
arg_name: param source:
name: $id file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: mixed ref: $id
description: | replacement:
The ``_id`` of the file to download. resource: " to download"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::downloadToStream
optional: false
position: 1
--- ---
arg_name: param source:
name: $destination file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: resource ref: $destination
description: |
Writable stream where the GridFS file's contents will be written.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::downloadToStream
optional: false
position: 2
... ...
arg_name: option source:
name: revision file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: integer ref: revision
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
... ...
arg_name: param source:
name: $filename file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: string ref: $filename
description: | replacement:
The ``filename`` of the file to download. resource: " to download"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
optional: false
position: 1
--- ---
arg_name: param source:
name: $destination file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: resource ref: $destination
description: |
Writable stream where the GridFS file's contents will be written.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
optional: false
position: 2
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
position: 3
... ...
arg_name: param source:
name: $stream file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: resource ref: $stream
description: |
The GridFS stream resource.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::getFileDocumentForStream
optional: false
position: 1
... ...
arg_name: param source:
name: $stream file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: resource ref: $stream
description: |
The GridFS stream resource.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::getFileIdForStream
optional: false
position: 1
... ...
arg_name: param source:
name: $id file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: mixed ref: $id
description: | replacement:
The ``_id`` of the file to download. resource: " to download"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::openDownloadStream
optional: false
position: 1
... ...
arg_name: option source:
name: revision file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: integer ref: revision
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
... ...
arg_name: param source:
name: $filename file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: string ref: $filename
description: | replacement:
The ``filename`` of the file to download. resource: " to download"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
position: 2
... ...
arg_name: option source:
name: _id file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: mixed ref: _id
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
--- ---
arg_name: option source:
name: chunkSizeBytes file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: integer ref: chunkSizeBytes
description: |
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::openUploadStream
optional: true
position: 2
--- ---
arg_name: option source:
name: metadata file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: array|object ref: metadata
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
... ...
arg_name: param source:
name: $filename file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: string ref: $filename
description: | replacement:
The ``filename`` of the file to create. resource: " to create"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::openUploadStream
optional: false
position: 1
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\GridFS\\Bucket::openUploadStream
position: 2
... ...
arg_name: param source:
name: $id file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: mixed ref: $id
description: | replacement:
The ``_id`` of the file to rename. resource: " to rename"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::rename
optional: false
position: 1
--- ---
arg_name: param arg_name: param
name: $newFilename name: $newFilename
...@@ -14,7 +10,6 @@ type: string ...@@ -14,7 +10,6 @@ type: string
description: | description: |
The new ``filename`` value. The new ``filename`` value.
interface: phpmethod interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::rename operation: ~
optional: false optional: false
position: 2
... ...
arg_name: option source:
name: _id file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: mixed ref: _id
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
--- ---
arg_name: option source:
name: chunkSizeBytes file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: integer ref: chunkSizeBytes
description: |
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
optional: true
position: 2
--- ---
arg_name: option source:
name: metadata file: apiargs-MongoDBGridFSBucket-common-option.yaml
type: array|object ref: metadata
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
... ...
arg_name: param source:
name: $filename file: apiargs-MongoDBGridFSBucket-common-param.yaml
type: string ref: $filename
description: | replacement:
The ``filename`` of the file to create. resource: " to create"
interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
optional: false
position: 1
--- ---
arg_name: param arg_name: param
name: $source name: $source
type: resource type: resource
description: | 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 interface: phpmethod
operation: MongoDB\\GridFS\\Bucket::uploadFromStream operation: ~
optional: false optional: false
position: 2
--- ---
source: source:
file: apiargs-common-param.yaml file: apiargs-common-param.yaml
ref: $options ref: $options
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
position: 3
... ...
arg_name: option 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 name: readConcern
type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>` type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
description: | description: |
...@@ -7,35 +18,34 @@ description: | ...@@ -7,35 +18,34 @@ description: |
interface: phpmethod interface: phpmethod
operation: selectCollection operation: selectCollection
optional: true optional: true
position: 1
replacement: replacement:
resource: "collection" resource: "collection"
parent: "client" parent: "client"
--- ---
arg_name: option arg_name: option
name: readPreference
type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
description: | description: |
The default read preference to use for {{resource}} operations. Defaults to The default read preference to use for {{resource}} operations. Defaults to
the {{parent}}'s read preference. the {{parent}}'s read preference.
interface: phpmethod interface: phpmethod
name: readPreference operation: ~
operation: selectCollection
optional: true optional: true
position: 2
type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
replacement: replacement:
resource: "collection" resource: "collection"
parent: "client" parent: "client"
--- ---
arg_name: option arg_name: option
name: typeMap
type: array
description: | description: |
Default type map for cursors and BSON documents. Defaults to the The :php:`type map
{{parent}}'s 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 interface: phpmethod
name: typeMap operation: ~
operation: selectCollection
optional: true optional: true
position: 3
type: array
replacement: replacement:
parent: "client" parent: "client"
--- ---
...@@ -46,51 +56,9 @@ description: | ...@@ -46,51 +56,9 @@ description: |
The default write concern to use for {{resource}} operations. Defaults The default write concern to use for {{resource}} operations. Defaults
to the {{parent}}'s write concern. to the {{parent}}'s write concern.
interface: phpmethod interface: phpmethod
operation: selectCollection operation: ~
optional: true optional: true
position: 4
replacement: replacement:
resource: "collection" resource: "collection"
parent: "client" 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
... ...
...@@ -7,7 +7,6 @@ description: | ...@@ -7,7 +7,6 @@ description: |
interface: phpmethod interface: phpmethod
operation: ~ operation: ~
optional: false optional: false
position: 1
--- ---
arg_name: param arg_name: param
name: $databaseName name: $databaseName
...@@ -19,7 +18,6 @@ operation: ~ ...@@ -19,7 +18,6 @@ operation: ~
optional: false optional: false
replacement: replacement:
action: "" action: ""
position: 1
--- ---
arg_name: param arg_name: param
name: $collectionName name: $collectionName
...@@ -31,7 +29,6 @@ operation: ~ ...@@ -31,7 +29,6 @@ operation: ~
optional: false optional: false
replacement: replacement:
action: "" action: ""
position: 2
--- ---
arg_name: param arg_name: param
name: $options name: $options
...@@ -41,17 +38,4 @@ description: | ...@@ -41,17 +38,4 @@ description: |
interface: phpmethod interface: phpmethod
operation: ~ operation: ~
optional: true 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"
... ...
...@@ -26,7 +26,7 @@ Definition ...@@ -26,7 +26,7 @@ Definition
.. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
The ``$options`` parameter accepts all index options that your MongoDB 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 .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
......
...@@ -19,37 +19,40 @@ Definition ...@@ -19,37 +19,40 @@ Definition
.. code-block:: php .. 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 :phpmethod:`MongoDB\\Collection::createIndexes()` has the following
element in ``$indexes`` must itself be an array that specifies an index. The parameters:
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()`.
For example, the following ``$indexes`` parameter creates two indexes. The .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
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::
[ The ``$options`` parameter supports the following options:
[ 'key' => [ 'username' => 1 ], 'unique' => true ],
[ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ],
]
You can specify any index options that your MongoDB version .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
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.
:returns: :returns:
The names of the created indexes as an array of strings. 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 Example
------- -------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment