@@ -39,7 +39,7 @@ Access a Database
39
39
40
40
Access a database by using dictionary-style access on your ``MongoClient`` instance.
41
41
42
- The following example accesses a database named " test_database" :
42
+ The following example accesses a database named `` test_database`` :
43
43
44
44
.. code-block:: python
45
45
@@ -50,7 +50,7 @@ Access a Collection
50
50
51
51
Access a collection by using dictionary-style access on an instance of your database.
52
52
53
- The following example accesses a collection named " test_collection" :
53
+ The following example accesses a collection named `` test_collection`` :
54
54
55
55
.. code-block:: python
56
56
:emphasize-lines: 2
@@ -70,7 +70,7 @@ Create a Collection
70
70
Use the ``create_collection()`` method to explicitly create a collection in a
71
71
MongoDB database.
72
72
73
- The following example creates a collection called ``" example_collection" ``:
73
+ The following example creates a collection called ``example_collection``:
74
74
75
75
.. code-block:: python
76
76
:emphasize-lines: 2
@@ -87,31 +87,31 @@ Time Series Collection
87
87
~~~~~~~~~~~~~~~~~~~~~~
88
88
89
89
Time series collections efficiently store sequences of measurements over a period of time.
90
- The following example creates a time series collection called ``" example_ts_collection" ``
91
- with a time field called ``" timestamp" ``:
90
+ The following example creates a time series collection called ``example_ts_collection``
91
+ in which the documents' time field is called ``timestamp``:
92
92
93
93
.. code-block:: python
94
94
95
95
database = client["test_database"]
96
96
database.create_collection("example_ts_collection", timeseries={"timeField": "timestamp"})
97
97
98
98
For more information about using time series data with {+driver-short+}, see the
99
- :ref:`< pymongo-time-series> ` guide.
99
+ :ref:`pymongo-time-series` guide.
100
100
101
101
Capped Collection
102
102
~~~~~~~~~~~~~~~~~
103
103
104
- Capped collections have a maximum size that prevent them from growing beyond a specified
105
- limit . The following example creates a capped collection called ``"example_capped_collection"``
106
- with a maximum size of 1000 bytes:
104
+ You can create a capped collection that cannot grow beyond a specified memory size or
105
+ document count . The following example creates a capped collection called
106
+ ``example_capped_collection`` that has a maximum size of 1000 bytes:
107
107
108
108
.. code-block:: python
109
109
110
110
database = client["test_database"]
111
111
database.create_collection("example_capped_collection", capped=True, size=1000)
112
112
113
- To learn more about capped collections, see the :manual:`Capped Collections </core/capped-collections/>`
114
- guide in the {+mdb-server+} manual.
113
+ To learn more about capped collections, see :manual:`Capped Collections </core/capped-collections/>`
114
+ in the {+mdb-server+} manual.
115
115
116
116
Get a List of Collections
117
117
-------------------------
0 commit comments