1) Create a new temporary time-series collection
|
2) FindOne a bucket in the original time-series collection with a mixed type min/max and obtain the bucket _id value
|
3) Fetch and unpack all documents in that bucket
|
4) Insert each document into a temp time-series collection in time ascending order
|
5) Open a transaction
|
a) For each bucket in the temp collection, copy to the original collection
|
b) Remove the original bucket document by _id
|
c) Remove all buckets in the temp collection
|
6) Commit transaction
|
7) Goto Step 2
|