Geo
10/05/2023, 1:26 AMcharts_display
and charts_insert
. My code always reads from charts_display
and inserts new data to charts_insert
.
• When not reindexing, these should point to the same collection.
• When reindexing, I create a new collection, point charts_insert
to it, wait for the reindex to complete, point both aliases to the new collection, and delete the old collection.
What I'd like to do is name the fully-indexed collection as _charts_display
and the in-progress collection as _charts_insert
. When I point charts_display
to _charts_insert
, I would want to rename it to _charts_display
and have it replace the existing one. But currently, renaming collections is not possible.
I know the alternative (as suggested in the docs) is to append something like _june11
to the collection name and never reuse collection names. But this involves writing code to figure out what the latest name should be, which is more tedious and unnecessary if renaming is possible. The "alias" feature seems built for these situations, but it's still not ideal, since I'd want to use collection renaming anyway. I think it would make sense if collections were actually identified by an internal unique id, which is what aliases would track instead of collection_name
. That way when collections are renamed, the id remains the same, and the alias continues to work.Kishore Nallan
10/05/2023, 3:15 AM