Nhảy tới nội dung

Float

Lưu ý sau khi phiên bản KeystoneJS 5 chuyển sang chế độ duy trì để ra mắt phiên bản mới hơn. Chúng tôi đã dựa trên mã nguồn cũ này để phát triển một phiên bản khác với một số tính năng theo hướng microservices.

An imprecise numeric value, stored as a floating point.

Usage

const { Float, DateTime } = require("@ocop/fields");

ocop.createList("SensorReading", {
fields: {
loggedAt: { type: DateTime },
temperature: { type: Float },
humidity: { type: Float },
},
});

Config

OptionTypeDefaultDescription
isRequiredBooleanfalseDoes this field require a value?
isUniqueBooleanfalseAdds a unique index that allows only unique values to be stored