MongoDB: create dynamic view from expanding set of collections
In principle you can do it like this:
var pipeline = []
firstCol = db.getSiblingDB('config').collections.findOne({_id: /Captures/ }).sort( {_id: 1} )
db.getSiblingDB('config').collections.find({_id: /Captures/ }).sort( {_id: 1} ).skip(1).forEach( ( col ) => {
pipeline.push({ $unionWith: col._id })
})
db.createView("AllCaptures", firstCol , pipeline)
Or course, you would have to run this procedure every day when a new collection is created. Test it carefully, the performance might a horrible. I assume in the end you will query the collections one by one.
BTW, instead of "copy and rename" the collection, consider just to rename it. If you try to insert data into a collection which does not exist, then MongoDB creates a new collection automatically. You may only have to create some indexes on the new collection.