When I remove the field “timeseries”, I read the error “error during aggregation :: caused by :: Taking mydatabase.weathernew lock for timeseries is not allowed”.
My question:
Can I use $out like the documentation “Migrate Data into a Time Series Collection”?
If yes, how can I resolve the error about the “lock for timeseries”?
Hi @Karima_Rafes and welcome to MongoDB community forums!!
Using $out to Time Series collection has been updated in MongoDB version 7.0.3.
The documentation “Migrate Data into a Time Series Collection” now recommends using $out to a “non-Time Series” collection to correctly transform data for a Time Series collection.
Prior to version 7.0.3, you will have to migrate the data using mongodump and mongorestore to the time series collection. The detailed steps are mentioned in the documentation for MongoDB version 6.0.
I understand the documentation does not clarify the version and this has been raised internally.
However, to answer your questions:
1.
If you are on version 7.0.3 and above, the answer would be yes. But prior to version 7.0.3, you will have to use to the dump/restore method to migrate.