File tree Expand file tree Collapse file tree 2 files changed +42
-29
lines changed
includes/usage-examples/code-snippets Expand file tree Collapse file tree 2 files changed +42
-29
lines changed Original file line number Diff line number Diff line change @@ -153,31 +153,37 @@ existing document in the ``restaurants`` collection. Select the
153
153
The following code uses structs to define and delete a document in the
154
154
``restaurants`` collection:
155
155
156
- .. input:: /includes/usage-examples/code-snippets/deleteOne.go
157
- :language: go
158
- :dedent:
156
+ .. io-code-block::
157
+ :copyable: true
159
158
160
- .. output::
161
- :language: none
162
- :visible: false
159
+ .. input:: /includes/usage-examples/code-snippets/deleteOne.go
160
+ :language: go
161
+ :dedent:
163
162
164
- Documents deleted: 1
163
+ .. output::
164
+ :language: none
165
+ :visible: false
166
+
167
+ Documents deleted: 1
165
168
166
169
.. tab:: bson.D
167
170
:tabid: bsonExample
168
171
169
172
The following code uses a bson.D type to define and delete a document in the
170
173
``restaurants`` collection:
171
174
172
- .. input:: /includes/usage-examples/code-snippets/deleteOneBson.go
173
- :language: go
174
- :dedent:
175
+ .. io-code-block::
176
+ :copyable: true
177
+
178
+ .. input:: /includes/usage-examples/code-snippets/deleteOneBson.go
179
+ :language: go
180
+ :dedent:
175
181
176
- .. output::
177
- :language: none
178
- :visible: false
182
+ .. output::
183
+ :language: none
184
+ :visible: false
179
185
180
- Documents deleted: 1
186
+ Documents deleted: 1
181
187
182
188
DeleteMany() Example: Full File
183
189
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -196,31 +202,38 @@ existing documents in the ``restaurants`` collection. Select the
196
202
The following code uses structs to define and delete documents in the
197
203
``restaurants`` collection:
198
204
199
- .. input:: /includes/usage-examples/code-snippets/deleteMany.go
200
- :language: go
201
- :dedent:
205
+ .. io-code-block::
206
+ :copyable: true
202
207
203
- .. output::
204
- :language: none
205
- :visible: false
208
+ .. input:: /includes/usage-examples/code-snippets/deleteMany.go
209
+ :language: go
210
+ :dedent:
211
+
206
212
207
- Documents deleted: 2
213
+ .. output::
214
+ :language: none
215
+ :visible: false
216
+
217
+ Documents deleted: 6
208
218
209
219
.. tab:: bson.D
210
220
:tabid: bsonExample
211
221
212
222
The following code uses a bson.D type to define and delete documents in the
213
223
``restaurants`` collection:
214
224
215
- .. input:: /includes/usage-examples/code-snippets/deleteManyBson.go
216
- :language: go
217
- :dedent:
225
+ .. io-code-block::
226
+ :copyable: true
227
+
228
+ .. input:: /includes/usage-examples/code-snippets/deleteManyBson.go
229
+ :language: go
230
+ :dedent:
218
231
219
- .. output::
220
- :language: none
221
- :visible: false
232
+ .. output::
233
+ :language: none
234
+ :visible: false
222
235
223
- Documents deleted: 2
236
+ Documents deleted: 6
224
237
225
238
Additional Information
226
239
----------------------
Original file line number Diff line number Diff line change @@ -58,6 +58,6 @@ func main() {
58
58
// Prints the number of deleted documents
59
59
fmt .Printf ("Documents deleted: %d\n " , result .DeletedCount )
60
60
61
- // When you run this file for the first time, it should print :
61
+ // When you run this file for the first time, it prints output similar to the following :
62
62
// Documents deleted: 1
63
63
}
You can’t perform that action at this time.
0 commit comments