Answer: In latest version of express (v5) req.query is changed to be a getter so I guess it is immutable now, I remember I have been using express 4 for my previous project which for that version req.query is still mutable.
The solution I found is to mutate req.url instead which reflect the changes made in it to req.query