Decimal / Float in mongoose for node.js
You can use the Decimal128 in Mongoose Schema as
speed:{
type:mongoose.Types.Decimal128
}
I've searched a bit and found this article stating that for storing float values you must use Number
type. You can store any float value in speed
field.
Yes you can use the Decimal128
type.
https://mongoosejs.com/docs/api.html#mongoose_Mongoose-Decimal128