Hello Anshul,
in a pure CQRS (or even DDD) approach, commands will always target a single aggregate at a time. The scenario you describe is basically a batch scenario, which consists of a query (find all aggregates with a specific state) and then a number of commands (update each of those aggregates).
The reason for this approach, is that the aggregate itself is, first of all, a consistency boundary. It is responsible for maintaining a valid state at all times. Traditional systems don't take this approach, but instead allow services to update data directly when they see fit.
So in your case, there is a mechanism (which could be triggered by a command) that would execute a query to locate all relevant aggregates and then send a command to each of the individual aggregates to remove the "oldId".
Hope this helps.
Cheers,
Allard