@@ -13,34 +13,30 @@ for provisioning, running, monitoring, and maintaining MongoDB deployments. It
13
13
is a fast, easy, and free way to get started with MongoDB. To install and run
14
14
MongoDB locally, see :ref:`Install MongoDB<tutorial-installation>`.
15
15
16
- .. tabs-gs ::
16
+ .. tabs-drivers ::
17
17
18
18
tabs:
19
19
- id: shell
20
- name: Mongo Shell
21
20
content: |
22
21
The following tutorial uses
23
22
:program:`mongo` shell to connect to an Atlas free-tier cluster, insert
24
23
data, and perform query operations.
25
24
26
25
- id: compass
27
- name: Compass
28
26
content: |
29
27
`MongoDB Compass <https://docs.mongodb.com/compass/current/>`_ is the
30
28
GUI for MongoDB. The following tutorial uses MongoDB Compass to connect
31
29
to an Atlas free-tier cluster, insert data, and perform query
32
30
operations.
33
31
34
32
- id: python
35
- name: Python
36
33
content: |
37
34
The following tutorial uses the
38
35
`PyMongo <https://api.mongodb.com/python/current/index.html>`_ Python
39
36
driver to connect to an Atlas free-tier cluster, insert data, and
40
37
perform query operations.
41
38
42
39
- id: nodejs
43
- name: Node.js
44
40
content: |
45
41
The following tutorial uses the :node-docs:`MongoDB Node.js Driver <>`
46
42
to connect to an Atlas free-tier cluster, then perform insert and query
@@ -62,11 +58,10 @@ MongoDB databases hold collections of documents.
62
58
Insert Documents
63
59
----------------
64
60
65
- .. tabs-gs ::
61
+ .. tabs-drivers ::
66
62
67
63
tabs:
68
64
- id: shell
69
- name: Mongo Shell
70
65
content: |
71
66
:method:`db.collection.insertMany()` can insert *multiple*
72
67
:ref:`documents <bson-document-format>` into a collection. Pass an
@@ -99,7 +94,6 @@ Insert Documents
99
94
Use :method:`db.collection.insertOne()` to insert a single document.
100
95
101
96
- id: compass
102
- name: Compass
103
97
content: |
104
98
1. Click :guilabel:`Create Database`.
105
99
@@ -159,7 +153,6 @@ Insert Documents
159
153
size: { h: 10, w: 15.25, uom: "cm" }, tags: [ "blue" ] }
160
154
161
155
- id: python
162
- name: Python
163
156
content: |
164
157
:py:meth:`pymongo.collection.Collection.insert_many` can insert
165
158
*multiple* :ref:`documents <bson-document-format>` into a collection.
@@ -193,7 +186,6 @@ Insert Documents
193
186
single document.
194
187
195
188
- id: nodejs
196
- name: Node.js
197
189
content: |
198
190
:node-api:`Collection.insertMany() <Collection.html#insertMany>` can
199
191
insert *multiple* :ref:`documents <bson-document-format>` into a
@@ -238,18 +230,16 @@ Query Documents
238
230
Select All Documents
239
231
~~~~~~~~~~~~~~~~~~~~
240
232
241
- .. tabs-gs ::
233
+ .. tabs-drivers ::
242
234
243
235
tabs:
244
236
- id: shell
245
- name: Mongo Shell
246
237
content: |
247
238
To select all documents in the collection, pass an empty document as the
248
239
:ref:`query filter document <document-query-filter>` to the
249
240
:method:`db.collection.find()` method:
250
241
251
242
- id: compass
252
- name: Compass
253
243
content: |
254
244
Select the ``inventory`` collection from the :guilabel:`Collections`
255
245
tab or the left-hand pane. By default, all documents are selected and
@@ -262,26 +252,23 @@ Select All Documents
262
252
.. include:: /images/compass-find-all.rst
263
253
264
254
- id: python
265
- name: Python
266
255
content: |
267
256
To select all documents in the collection, pass an empty document as the
268
257
:ref:`query filter document <document-query-filter>` to the
269
258
:py:meth:`pymongo.collection.Collection.find` method:
270
259
271
260
- id: nodejs
272
- name: Node.js
273
261
content: |
274
262
To select all documents in the collection, pass an empty document as the
275
263
:ref:`query filter document <document-query-filter>` to the
276
264
:node-api:`Collection.find() <Collection.html#find>` method:
277
265
278
266
.. include:: /includes/driver-example-query-7.rst
279
267
280
- .. tabs-gs ::
268
+ .. tabs-drivers ::
281
269
282
270
tabs:
283
271
- id: shell
284
- name: Mongo Shell
285
272
content: |
286
273
To query for documents that match specific equality conditions, pass the
287
274
:method:`~db.collection.find()` method a :ref:`query filter document <document-query-filter>`
@@ -290,7 +277,6 @@ Select All Documents
290
277
equals ``"D"``:
291
278
292
279
- id: compass
293
- name: Compass
294
280
content: |
295
281
To query for documents that match specific equality conditions, pass
296
282
a :ref:`query filter document <document-query-filter>` to the
@@ -306,7 +292,6 @@ Select All Documents
306
292
.. include:: /images/compass-find-filter.rst
307
293
308
294
- id: python
309
- name: Python
310
295
content: |
311
296
To query for documents that match specific equality conditions, pass the
312
297
:py:meth:`~pymongo.collection.Collection.find` method a
@@ -316,7 +301,6 @@ Select All Documents
316
301
``status`` equals ``"D"``:
317
302
318
303
- id: nodejs
319
- name: Node.js
320
304
content: |
321
305
To query for documents that match specific equality conditions, pass the
322
306
:node-api:`find() <Collection.html#find>` method a
@@ -336,11 +320,10 @@ equals the document ``{ h: 14, w: 21, uom: "cm" }``:
336
320
337
321
.. include:: /includes/driver-example-query-15.rst
338
322
339
- .. tabs-gs ::
323
+ .. tabs-drivers ::
340
324
341
325
tabs:
342
326
- id: compass
343
- name: Compass
344
327
content: |
345
328
.. class:: copyable-code
346
329
.. code-block:: javascript
@@ -357,11 +340,10 @@ nested in the ``size`` field equals the string value ``"in"``:
357
340
358
341
.. include:: /includes/driver-example-query-17.rst
359
342
360
- .. tabs-gs ::
343
+ .. tabs-drivers ::
361
344
362
345
tabs:
363
346
- id: compass
364
- name: Compass
365
347
content: |
366
348
.. class:: copyable-code
367
349
.. code-block:: javascript
@@ -378,11 +360,10 @@ array that contains the string ``"red"`` as one of its elements:
378
360
379
361
.. include:: /includes/driver-example-query-23.rst
380
362
381
- .. tabs-gs ::
363
+ .. tabs-drivers ::
382
364
383
365
tabs:
384
366
- id: compass
385
- name: Compass
386
367
content: |
387
368
.. class:: copyable-code
388
369
.. code-block:: javascript
@@ -400,11 +381,10 @@ in the specified order:
400
381
401
382
.. include:: /includes/driver-example-query-21.rst
402
383
403
- .. tabs-gs ::
384
+ .. tabs-drivers ::
404
385
405
386
tabs:
406
387
- id: compass
407
- name: Compass
408
388
content: |
409
389
.. class:: copyable-code
410
390
.. code-block:: javascript
0 commit comments