Search code examples
javascriptmongoosekeystonejs

Set default for Types.Money in KeystoneJS


How do I set a default for Types.Money in KeystoneJS?

This I know there isn't an option for it — and this won't work.

price: { type: Types.Money, format: '$0,0.00', currency: 'en-gb', default: '50'}

Any ideas?


Solution

  • This is now supported with the current version of KeystoneJS.

    I couldn't find it in the change logs but it definitely works now. https://github.com/keystonejs/keystone/blob/master/HISTORY.md