<!-- llms-explorer concept facts · https://llms-explorer.com/tree/out-based-time-series-rewrite-and-cutover/ · pack 2026-10-31 · ~1886 tokens -->

# $out-based time series rewrite and cutover

> Source-anchored research for $out-based time series rewrite and cutover. Run status: COMPLETED.

Parent: [Bucket fragmentation remediation (re-insert/merge)](https://llms-explorer.com/tree/bucket-fragmentation-remediation-re-insert-merge/) · 4 facets · 18 facts · page: https://llms-explorer.com/tree/out-based-time-series-rewrite-and-cutover/

## How it works

- SERVER-111834 remains Unresolved with no fix version when checked on 2026-10-30. Its reproduction drops the default time-series index, runs $out into that target, and observes the default index recreated. Inspect indexes after a rewrite. (low confidence) (verified as of 2026-10-30) — [source](https://jira.mongodb.org/browse/SERVER-111834)
- A same-database rename takes exclusive locks on the source and target collections and invalidates open cursors, interrupting queries that are returning data. A manual rename cutover needs allowance for this interruption, even when the data rewrite has already finished. (low confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/reference/command/renameCollection.md)

## Problems, failure modes and limitations

- A March 2024 report on MongoDB 7.0.6 received the misleading error "$out to time-series collections is only supported on fcv greater than or equal to 7.1". Completing the upgrade by setting FCV to 7.0 resolved it for the reporter; do not interpret this historical message alone as requiring a 7.1 server. (low confidence) — [source](https://www.mongodb.com/community/forums/t/out-aggregation-not-updating-my-time-series-colecction-fcv-greater-than-7-1-error/271256)
- The current MongoDB master OutStage::finalize code warns that legacy time-series bucket rename and view creation cannot both be guaranteed across an unclean shutdown; interruption can leave buckets without a view. This is a code-level caveat for the legacy representation, not proof that every supported release has identical behavior. (low confidence) (verified as of 2026-10-30) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/exec/agg/out_stage.cpp)
- For an existing target, $out builds a temporary collection, copies target index definitions, writes results, then replaces the target through rename with dropTarget:true. MongoDB documents atomic replacement and preservation of the existing target on aggregation failure; the server implementation confirms this temporary-collection sequence. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- $out cannot target a sharded collection and cannot run inside a transaction. These restrictions rule out treating a sharded production target or a transaction wrapper as an automatic solution for rewrite cutover. (low confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)

## Comparisons and alternatives

- MongoDB 7.0.3 and 7.1 introduced $out with a timeseries specification. It writes pipeline measurements into a time-series target; it is a collection rewrite mechanism rather than an in-place bucket merge. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- An existing $out time-series target must have matching timeseries options. To change timeField or metaField, create a differently named target instead of replacing the existing target with incompatible options. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- Time series output support starts at MongoDB 7.0.3 and 7.1, rather than every 7.0 patch. A first-hand report on 7.0.1 records '$out supports only db and coll' and a time series collection-lock error; MongoDB's reply identifies 7.0.3 as the support boundary. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- SERVER-111834 reports that $out recreates a time series target's default index even if the operator dropped it beforehand. The issue's September 25, 2026 update lists it as unresolved with no fix version, so inspect the rebuilt index set rather than assuming exact preservation of index absence. (low confidence) (verified as of 2026-09-25) — [source](https://jira.mongodb.org/browse/SERVER-111834)
- Yannick Jaquier's MongoDB 8.0.5 reload experiment reports 9,935,137 buckets with its initial metadata configuration versus 111,312 after removing that metaField configuration at seconds granularity. This is evidence that rebuild configuration can dominate bucket density; it is not a benchmark of $out or a guaranteed rewrite savings ratio. (low confidence) — [source](https://blog.yannickjaquier.com/mongodb/mongodb-time-series-collection-hands-on.html)

## Facts and statements

- $out builds a temporary collection and replaces an existing destination at completion. Its time-series implementation inserts measurements through insertTimeseries, which makes fresh bucket construction possible; it does not copy source bucket documents unchanged. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- Repeated $out operations against one destination replace previous results; they do not append successive sensor subsets. A user reported exactly this obstacle during time-series migration. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- Treat write coordination as a separate cutover requirement: the destination replacement does not reconcile concurrent application writes. Extenify explicitly schedules its migration before the new writer starts; using a quiesced source or separately verified reconciliation is an operational inference from replacement semantics. (medium confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
- Public renameCollection support for time series collections begins in MongoDB 9.0. A staged rewrite followed by an application-issued rename therefore requires a version check; the internal rename used by supported $out implementations does not establish public rename support on older releases. (high confidence) (verified as of 2026-10-05) — [source](https://www.mongodb.com/docs/manual/reference/command/renameCollection.md)
- For a newly created migration destination, source secondary indexes require manual recreation. For replacement of an existing destination, $out instead copies that destination's index definitions; source indexes and target indexes must therefore be distinguished during validation. (high confidence) — [source](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-migrate-with-aggregation.md)
- TideWave recommends copying a representative week into a separate time-series target with $out and comparing collection stats before migrating the remainder. This is a proposed measurement method, not published evidence of a particular fragmentation-reduction ratio. (low confidence) — [source](https://tidewave.net/blog/mongodb-time-series-collections-storing-iot-and-metrics-data-efficiently)
- Explicit timeseries options must match an existing time series target. To change bucketing configuration during a rewrite, use a separate destination with the desired options; replacing the original target with mismatched options is rejected. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md)
