Problem setting bucketMaxSpanSeconds and bucketRoundingSeconds in MongoDB timeseries collection

I am using MongoDB version 7.0.2 (upgraded from 6.0.3) which offers the feature of setting bucketMaxSpanSeconds and bucketRoundingSeconds according to the official document. But when I execute the following commands:

db.createCollection( "weather24h", { timeseries: { timeField: "timestamp", metaField: "metadata", bucketMaxSpanSeconds: 300, bucketRoundingSeconds: 300 } } )

I am getting the error:

Timeseries 'bucketMaxSpanSeconds' is not configurable to a value other than the default of 3600 for the provided granularity

Can it be due to the upgrade? Any help regarding this would be appreciated.

Hi @Yashasvi_Pant

You did not complete the upgrade correctly, follow the upgrade procedure in the release notes. Then the above command will complete correctly.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.