MongoDB’s internal document representation uses the BSON binary serialisation format which supports standard JSON data types as well as extended types which are not native to JavaScript (for example, 32-bit and 64-bit integers).
JavaScript’s built-in Number type is a double-precision 64-bit binary value which maps to the BSON type of double.
To align your data model with validation you could:
Use the NumberInt() wrapper to pass a value as a 32-bit integer in the mongo shell. Drivers also support extended MongoDB type representations but will use naming consistent with the driver API.
Change your validator to use the double type to match JavaScript’s default Number type.
Change your validator to use the number BSON alias which will match against any numeric type (32-bit integer, 64-bit integer, double, or decimal128).
The number alias provides some flexibility for numeric fields with a range of values that may require different numeric precision.
For example, a 32-bit integer (int32) uses fewer bytes in an uncompressed document than a double or decimal128 value: