You can’t, as HTTP has no notion of types: everything is a string, including querystring parameters.
What you’ll need to do is to use the req.query
object and manually transform the strings into integers using parseInt()
:
req.query.someProperty = parseInt(req.query.someProperty);