Remove trivial decimal implementation and use float type instead #550

This commit is contained in:
Aurelsicoko 2018-02-06 15:10:14 +01:00
parent 7f2a5cbb66
commit 065346e7ef

View File

@ -9,9 +9,12 @@ module.exports = mongoose => {
const SchemaTypes = mongoose.Schema.Types;
SchemaTypes.Decimal.prototype.cast = function (value) {
return value.toString();
};
// Note: The decimal format isn't well supported by MongoDB.
// It's recommended to use Float or Number type instead.
//
// SchemaTypes.Decimal.prototype.cast = function (value) {
// return value.toString();
// };
return {
convertType: mongooseType => {
@ -25,9 +28,8 @@ module.exports = mongoose => {
case 'biginteger':
return 'Number';
case 'float':
return 'Float';
case 'decimal':
return 'Decimal';
return 'Float';
case 'date':
case 'time':
case 'datetime':