Reputation: 6031
The docs have that much to say about NumberInt
By default, the mongo shell treats all numbers as floating-point values. The mongo shell provides the NumberInt() constructor to explicitly specify 32-bit integers.
Which doesn't specify if they are signed or not, ie; if they can handle negative numbers.
I'm about to find out real soon, but for further reference I thought this question might help others find out quicker.
Upvotes: 0
Views: 589
Reputation: 311865
Yes, NumberInt
supports negative values. In the mongo shell:
> x = NumberInt(-10)
NumberInt(-10)
Upvotes: 1