Skip to content

Commit fff7e9d

Browse files
committed
Replace apiargs for Database methods
1 parent 8d1f9ac commit fff7e9d

16 files changed

+937
-78
lines changed

docs/reference/method/MongoDBDatabase-aggregate.txt

Lines changed: 97 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,107 @@ Definition
2424

2525
.. code-block:: php
2626

27-
function aggregate(array $pipeline, array $options = []): Traversable
27+
function aggregate(
28+
array $pipeline,
29+
array $options = []
30+
): Traversable
2831

29-
This method has the following parameters:
32+
Parameters
33+
----------
34+
35+
``$pipeline`` : array
36+
Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>`
37+
operation.
38+
39+
``$options`` : array
40+
An array specifying the desired options.
41+
42+
.. |parent| replace:: database
43+
44+
.. list-table::
45+
:header-rows: 1
46+
:widths: 20 20 80
47+
48+
* - Name
49+
- Type
50+
- Description
51+
52+
* - allowDiskUse
53+
- boolean
54+
- Enables writing to temporary files. When set to ``true``, aggregation
55+
stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
56+
directory.
57+
58+
* - batchSize
59+
- integer
60+
- Specifies the batch size for the cursor, which will apply to both the
61+
initial ``aggregate`` command and any subsequent ``getMore`` commands.
62+
This determines the maximum number of documents to return in each
63+
response from the server.
64+
65+
A batchSize of ``0`` is special in that and will only apply to the
66+
initial ``aggregate`` command; subsequent ``getMore`` commands will use
67+
the server's default batch size. This may be useful for quickly
68+
returning a cursor or failure from ``aggregate`` without doing
69+
significant server-side work.
70+
71+
* - bypassDocumentValidation
72+
- boolean
73+
- If ``true``, allows the write operation to circumvent document level
74+
validation. Defaults to ``false``.
75+
76+
This only applies when using the :ref:`$out <agg-out>` and
77+
:ref:`$out <agg-merge>` stages.
78+
79+
* - collation
80+
- array|object
81+
- .. include:: /includes/option-collation.rst
82+
83+
* - comment
84+
- mixed
85+
- .. include:: /includes/option-comment.rst
86+
87+
The comment can be any valid BSON type for server versions 4.4 and
88+
above. Earlier server versions only support string values.
89+
90+
* - explain
91+
- boolean
92+
- Specifies whether or not to return the information on the processing of
93+
the pipeline.
94+
95+
* - hint
96+
- string|array|object
97+
- .. include:: /includes/option-hint.rst
98+
99+
* - let
100+
- array|object
101+
- .. include:: /includes/option-let.rst
102+
103+
.. versionadded:: 1.9
104+
105+
* - maxTimeMS
106+
- integer
107+
- .. include:: /includes/option-maxTimeMS.rst
108+
109+
* - readConcern
110+
- :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
111+
- .. include:: /includes/option-readConcern.rst
112+
113+
* - readPreference
114+
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
115+
- .. include:: /includes/option-readPreference.rst
30116

31-
.. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-param.rst
117+
* - session
118+
- :php:`MongoDB\\Driver\\Session <class.mongodb-driver-session>`
119+
- .. include:: /includes/option-session.rst
32120

33-
The ``$options`` parameter supports the following options:
121+
* - typeMap
122+
- array
123+
- .. include:: /includes/option-typeMap.rst
34124

35-
.. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-option.rst
125+
* - writeConcern
126+
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
127+
- .. include:: /includes/option-writeConcern.rst
36128

37129
Return Values
38130
-------------

docs/reference/method/MongoDBDatabase-command.txt

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,43 @@ Definition
2121

2222
.. code-block:: php
2323

24-
function command(array|object $command, array $options = []): MongoDB\Driver\Cursor
24+
function command(
25+
array|object $command,
26+
array $options = []
27+
): MongoDB\Driver\Cursor
2528

26-
This method has the following parameters:
29+
Parameters
30+
----------
31+
32+
``$command`` : array|object
33+
The :manual:`database command </reference/command>` document.
34+
35+
``$options`` : array
36+
An array specifying the desired options.
37+
38+
.. |parent| replace:: database
39+
40+
.. list-table::
41+
:header-rows: 1
42+
:widths: 20 20 80
43+
44+
* - Name
45+
- Type
46+
- Description
47+
48+
* - readPreference
49+
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
50+
- .. include:: /includes/option-readPreference.rst
2751

28-
.. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
52+
* - session
53+
- :php:`MongoDB\\Driver\\Session <class.mongodb-driver-session>`
54+
- .. include:: /includes/option-session.rst
2955

30-
The ``$options`` parameter supports the following options:
56+
.. versionadded:: 1.3
3157

32-
.. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
58+
* - typeMap
59+
- array
60+
- .. include:: /includes/option-typeMap.rst
3361

3462
Return Values
3563
-------------

0 commit comments

Comments
 (0)