Number values are saved as strings in firestore

Declarations, e.g.:

const occupationId: number

by themselves do not convert passed data in case if the assignment type is any (it's done so that it was possible to gradually switch from js to ts).

If you need to have a number explicitly - you need to use something that converts the actual value type for you.

One possible way to do that:

const occupationId: number = Number(request.body['occupationId']);

References:

  • MDN: Number - Convert numeric strings to numbers