File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
- require 'vendor/autoload.php ' ; // Ensure you have MongoDB PHP library installed
2
+ require 'vendor/autoload.php ' ;
3
3
4
4
$ uri = getenv ('MONGODB_URI ' ) ?: throw new RuntimeException ('Set the MONGODB_URI variable to your Atlas URI that connects to the sample dataset ' );
5
5
$ client = new MongoDB \Client ($ uri );
29
29
// Deletes and prints the number of documents that have a "cuisine" value of "Greek"
30
30
// start-delete-count
31
31
$ result = $ collection ->deleteMany (['cuisine ' => 'Greek ' ]);
32
- echo $ result ->getDeletedCount () . PHP_EOL ;
32
+ echo ' Deleted documents: ' . $ result ->getDeletedCount () . PHP_EOL ;
33
33
// end-delete-count
34
34
35
- ?>
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ operation:
145
145
:language: php
146
146
:dedent:
147
147
148
- .. tip ::
148
+ .. note ::
149
149
150
150
If the preceding example used the ``deleteOne()`` method instead of
151
151
``deleteMany()``, the driver would delete only the first document that has
@@ -173,6 +173,7 @@ that have a ``cuisine`` value of ``'Greek'``. It then calls the ``getDeletedCoun
173
173
member function to print the number of deleted documents:
174
174
175
175
.. io-code-block::
176
+ :copyable:
176
177
177
178
.. input:: /includes/write/delete.php
178
179
:start-after: start-delete-count
@@ -181,11 +182,12 @@ member function to print the number of deleted documents:
181
182
:dedent:
182
183
183
184
.. output::
185
+ :visible: false
184
186
185
187
Deleted documents: 111
186
188
187
189
API Documentation
188
- ~~~~~~~~~~~~~~~~~
190
+ -----------------
189
191
190
192
To learn more about any of the methods or types discussed in this
191
193
guide, see the following API documentation:
You can’t perform that action at this time.
0 commit comments