mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Remove trivial decimal implementation and use float type instead #550
This commit is contained in:
parent
7f2a5cbb66
commit
065346e7ef
@ -9,9 +9,12 @@ module.exports = mongoose => {
|
|||||||
|
|
||||||
const SchemaTypes = mongoose.Schema.Types;
|
const SchemaTypes = mongoose.Schema.Types;
|
||||||
|
|
||||||
SchemaTypes.Decimal.prototype.cast = function (value) {
|
// Note: The decimal format isn't well supported by MongoDB.
|
||||||
return value.toString();
|
// It's recommended to use Float or Number type instead.
|
||||||
};
|
//
|
||||||
|
// SchemaTypes.Decimal.prototype.cast = function (value) {
|
||||||
|
// return value.toString();
|
||||||
|
// };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
convertType: mongooseType => {
|
convertType: mongooseType => {
|
||||||
@ -25,9 +28,8 @@ module.exports = mongoose => {
|
|||||||
case 'biginteger':
|
case 'biginteger':
|
||||||
return 'Number';
|
return 'Number';
|
||||||
case 'float':
|
case 'float':
|
||||||
return 'Float';
|
|
||||||
case 'decimal':
|
case 'decimal':
|
||||||
return 'Decimal';
|
return 'Float';
|
||||||
case 'date':
|
case 'date':
|
||||||
case 'time':
|
case 'time':
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user