@@ -57,38 +57,34 @@ To create a time series collection, pass the following parameters to the
5757 :language: csharp
5858 :dedent:
5959
60- To check if you successfully created the collection, send the
61- ``"listCollections"`` command to the ``RunCommand()`` method as shown in the following
62- example:
60+ To check if you successfully created the collection, use the ``ListCollections()`` or
61+ ``ListCollectionsAsync()`` method as shown in the following example:
6362
6463.. literalinclude:: /includes/fundamentals/code-examples/TimeSeries.cs
65- :start-after: begin-run-command
66- :end-before: end-run-command
64+ :start-after: begin-list-collections
65+ :end-before: end-list-collections
6766 :language: csharp
6867 :dedent:
6968
7069Your output will look similar to the following:
7170
7271.. code-block:: json
7372
74- {
75- "cursor":{
76- ...
77- "firstBatch":[
78- {
79- "name":"september2021",
80- "type":"timeseries",
81- "options":{
82- "timeseries":{
83- ...
84- }
85- },
86- "info":{
87- "readOnly":false
88- }
89- },
90- ...
91- }
73+ {
74+ "name": "september2021",
75+ "type": "timeseries",
76+ "options": {
77+ "timeseries": {
78+ "timeField": "temperature",
79+ "granularity": "seconds",
80+ "bucketMaxSpanSeconds": 3600
81+ }
82+ },
83+ "info": {
84+ "readOnly": false
85+ }
86+ }
87+ ...
9288
9389Query a Time Series Collection
9490------------------------------
@@ -114,4 +110,5 @@ guide, see the following API documentation:
114110- `CreateCollection() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoDatabase.CreateCollection.html>`__
115111- `CreateCollectionOptions <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.CreateCollectionOptions.html>`__
116112- `TimeSeriesOptions <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.TimeSeriesOptions.html>`__
117- - `RunCommand() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoDatabase.RunCommand.html>`__
113+ - `ListCollections() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoDatabase.ListCollections.html>`__
114+ - `ListCollectionsAsync() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoDatabase.ListCollectionsAsync.html>`__
0 commit comments