Reputation: 1915
when a field is of type Number, mongoose will insert it as Int32 or double depending on the actual value:
5 -> Int32 5.3 -> double
Effectively the same field has different types depending on the entity inserted.
This is not an issue to read/write from javascript as both are converted to Number. However, if you are simultaneously using a driver from a strong typed language with both types, like C#, this becomes an issue.
Is it possible to configure mongoose to insert the Number always as double, like the mongo shell does?
Upvotes: 7
Views: 3363