@@ -56,9 +56,8 @@ Create a Time Series Collection
56
56
To create and interact with time series collections, you must be
57
57
connected to a deployment running {+mdb-server+} 5.0 or later.
58
58
59
- You can create a time series collection to store time series data. To create
60
- a time series collection, pass the following arguments to the ``create_collection()``
61
- method:
59
+ To create a time series collection, pass the following arguments to the
60
+ ``create_collection()`` method:
62
61
63
62
- Name of the new collection to create
64
63
- ``timeseries`` argument
@@ -96,19 +95,16 @@ The following example creates a time series collection named ``october2024`` wit
96
95
97
96
database.create_collection("october2024", timeseries=time_series_options)
98
97
99
- To check if you successfully created the collection, you can print out a list of
100
- all collections in the database:
98
+ To check if you successfully created the collection, you can get a list of all
99
+ collections in your database and filter by collection name.
101
100
102
101
.. io-code-block::
103
102
:copyable: true
104
103
105
104
.. input::
106
105
:language: python
107
106
108
- collection_list = database.list_collections()
109
-
110
- for c in collection_list:
111
- print(c)
107
+ print(list(database.list_collections(filter={'name': 'october2024'})))
112
108
113
109
.. output::
114
110
:language: json
@@ -128,7 +124,6 @@ all collections in the database:
128
124
"readOnly": False
129
125
}
130
126
}
131
- ...
132
127
133
128
.. _pymongo-time-series-write:
134
129
0 commit comments