Skip to content
KeystoneJS LogoKeystoneJS
👋🏻 Keystone 5 has officially moved to maintenance only. For the latest release of Keystone please visit the Keystone website.

Float

An imprecise numeric value, stored as a floating point.

Usage

JS
const { Float, DateTime } = require('@keystonejs/fields');

keystone.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

On this page

  • Usage
  • Config
Edit on GitHub