Skip to content

Commit ea9fc2f

Browse files
committed
DOCSP-44002: v2 void return types
1 parent 05f741b commit ea9fc2f

17 files changed

+78
-273
lines changed

source/includes/databases-collections/databases-collections.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// Explicitly creates the "example_collection" collection
3232
// start-create-collection
33-
$result = $client->test_database->createCollection('example_collection');
33+
$client->test_database->createCollection('example_collection');
3434
// end-create-collection
3535

3636
// Lists the collections in the "test_database" database

source/includes/databases-collections/time-series.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
]
1717
];
1818

19-
$collection = $db->createCollection('sept2023', $options);
19+
$db->createCollection('sept2023', $options);
2020
// end-create-ts
2121

2222
// Lists the collections in the "precipitation" database

source/includes/read/cursor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Creates a collection with a maximum size and inserts documents representing vegetables
3333
// start-capped-coll
3434
$db = $client->db;
35-
$create_coll = $db->createCollection(
35+
$db->createCollection(
3636
'vegetables',
3737
['capped' => true, 'size' => 1024 * 1024]
3838
);

source/indexes/index-mgmt.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ You can delete all indexes by calling the
127127
:end-before: end-remove-all-indexes
128128
:dedent:
129129

130-
The ``dropIndexes()`` method returns information about the number of
131-
indexes removed and a success message.
132-
133130
API Documentation
134131
~~~~~~~~~~~~~~~~~
135132

source/reference/method/MongoDBClient-dropDatabase.txt

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Client::dropDatabase()
33
===============================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -19,7 +17,7 @@ Definition
1917

2018
.. code-block:: php
2119

22-
function dropDatabase(string $databaseName, array $options = []): array|object
20+
function dropDatabase(string $databaseName, array $options = []): void
2321

2422
Parameters
2523
----------
@@ -62,13 +60,6 @@ Parameters
6260
- :php:`MongoDB\Driver\WriteConcern <class.mongodb-driver-writeconcern>`
6361
- .. include:: /includes/extracts/client-option-writeConcern.rst
6462

65-
Return Values
66-
-------------
67-
68-
An array or object with the result document of the :manual:`dropDatabase
69-
</reference/command/dropDatabase>` command. The return type will depend on the
70-
``typeMap`` option.
71-
7263
Errors/Exceptions
7364
-----------------
7465

@@ -87,23 +78,7 @@ The following example drops the ``test`` database:
8778

8879
$client = new MongoDB\Client;
8980

90-
$result = $client->dropDatabase('test');
91-
92-
var_dump($result);
93-
94-
The output would then resemble:
95-
96-
.. code-block:: none
97-
98-
object(MongoDB\Model\BSONDocument)#8 (1) {
99-
["storage":"ArrayObject":private]=>
100-
array(2) {
101-
["dropped"]=>
102-
string(4) "test"
103-
["ok"]=>
104-
float(1)
105-
}
106-
}
81+
$client->dropDatabase('test');
10782

10883
See Also
10984
--------

source/reference/method/MongoDBCollection-drop.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Definition
1919

2020
.. code-block:: php
2121

22-
function drop(array $options = []): array|object
22+
function drop(array $options = []): void
2323

2424
Parameters
2525
----------
@@ -79,15 +79,6 @@ Parameters
7979

8080
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
8181

82-
83-
84-
Return Values
85-
-------------
86-
87-
An array or object with the result document of the :manual:`drop
88-
</reference/command/drop>` command. The return type will depend on the
89-
``typeMap`` option.
90-
9182
Errors/Exceptions
9283
-----------------
9384

@@ -107,25 +98,7 @@ database:
10798

10899
$collection = (new MongoDB\Client)->test->restaurants;
109100

110-
$result = $collection->drop();
111-
112-
var_dump($result);
113-
114-
The output would then resemble:
115-
116-
.. code-block:: none
117-
118-
object(MongoDB\Model\BSONDocument)#9 (1) {
119-
["storage":"ArrayObject":private]=>
120-
array(3) {
121-
["ns"]=>
122-
string(16) "test.restaurants"
123-
["nIndexesWas"]=>
124-
int(3)
125-
["ok"]=>
126-
float(1)
127-
}
128-
}
101+
$collection->drop();
129102

130103
See Also
131104
--------

source/reference/method/MongoDBCollection-dropIndex.txt

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Collection::dropIndex()
33
================================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -22,7 +20,7 @@ Definition
2220
function dropIndex(
2321
string|MongoDB\Model\IndexInfo $indexName,
2422
array $options = []
25-
): array|object
23+
): void
2624

2725
Parameters
2826
----------
@@ -74,13 +72,6 @@ Parameters
7472

7573
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
7674

77-
Return Values
78-
-------------
79-
80-
An array or object with the result document of the :manual:`dropIndexes
81-
</reference/command/dropIndexes>` command. The return type will depend on the
82-
``typeMap`` option.
83-
8475
Errors/Exceptions
8576
-----------------
8677

@@ -100,23 +91,7 @@ collection in the ``test`` database:
10091

10192
$collection = (new MongoDB\Client)->test->restaurants;
10293

103-
$result = $collection->dropIndex('borough_1');
104-
105-
var_dump($result);
106-
107-
The output would then resemble:
108-
109-
.. code-block:: none
110-
111-
object(MongoDB\Model\BSONDocument)#9 (1) {
112-
["storage":"ArrayObject":private]=>
113-
array(2) {
114-
["nIndexesWas"]=>
115-
int(2)
116-
["ok"]=>
117-
float(1)
118-
}
119-
}
94+
$collection->dropIndex('borough_1');
12095

12196
See Also
12297
--------

source/reference/method/MongoDBCollection-dropIndexes.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Collection::dropIndexes()
33
==================================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -20,7 +18,7 @@ Definition
2018

2119
.. code-block:: php
2220

23-
function dropIndexes(array $options = []): array|object
21+
function dropIndexes(array $options = []): void
2422

2523
Parameters
2624
----------
@@ -72,13 +70,6 @@ Parameters
7270

7371
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
7472

75-
Return Values
76-
-------------
77-
78-
An array or object with the result document of the :manual:`dropIndexes
79-
</reference/command/dropIndexes>` command. The return type will depend on the
80-
``typeMap`` option.
81-
8273
Errors/Exceptions
8374
-----------------
8475

@@ -98,25 +89,7 @@ The following drops all indexes from the ``restaurants`` collection in the
9889

9990
$collection = (new MongoDB\Client)->test->restaurants;
10091

101-
$result = $collection->dropIndexes();
102-
103-
var_dump($result);
104-
105-
The output would then resemble:
106-
107-
.. code-block:: none
108-
109-
object(MongoDB\Model\BSONDocument)#9 (1) {
110-
["storage":"ArrayObject":private]=>
111-
array(3) {
112-
["nIndexesWas"]=>
113-
int(3)
114-
["msg"]=>
115-
string(38) "non-_id indexes dropped for collection"
116-
["ok"]=>
117-
float(1)
118-
}
119-
}
92+
$collection->dropIndexes();
12093

12194
See Also
12295
--------

source/reference/method/MongoDBCollection-dropSearchIndex.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ MongoDB\\Collection::dropSearchIndex()
44

55
.. versionadded:: 1.17
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none

source/reference/method/MongoDBCollection-rename.txt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ MongoDB\\Collection::rename()
44

55
.. versionadded:: 1.10
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none
@@ -25,7 +23,7 @@ Definition
2523
string $toCollectionName,
2624
?string $toDatabaseName = null,
2725
array $options = []
28-
): array|object
26+
): void
2927

3028
Parameters
3129
----------
@@ -79,13 +77,6 @@ Parameters
7977

8078
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
8179

82-
Return Values
83-
-------------
84-
85-
An array or object with the result document of the :manual:`renameCollection
86-
</reference/command/renameCollection>` command. The return type will depend on the
87-
``typeMap`` option.
88-
8980
Errors/Exceptions
9081
-----------------
9182

@@ -105,21 +96,7 @@ database to ``places``:
10596

10697
$collection = (new MongoDB\Client)->test->restaurants;
10798

108-
$result = $collection->rename('places');
109-
110-
var_dump($result);
111-
112-
The output would then resemble:
113-
114-
.. code-block:: none
115-
116-
object(MongoDB\Model\BSONDocument)#9 (1) {
117-
["storage":"ArrayObject":private]=>
118-
array(1) {
119-
["ok"]=>
120-
float(1)
121-
}
122-
}
99+
$collection->rename('places');
123100

124101
See Also
125102
--------

0 commit comments

Comments
 (0)