Skip to Page Navigation Skip to Page Navigation Skip to Content
Keystone 6
Blog Enterprise β†— Docs

JSON

A json field represents a JSON blob. Currently the json field is non-orderable and non-filterable.

  • defaultValue (default: null): Can be set to any JSON value. This value will be used for the field when creating items if no explicit value is set.
  • db.map: Adds a Prisma @map attribute to this field which changes the column name in the database
import{ config, list }from'@keystone-6/core';
import{ json }from'@keystone-6/core/fields';
exportdefaultconfig({
lists:{
SomeListName:list({
fields:{
someFieldName:json({
defaultValue:{ something:true},
db:{ map:'my_json'},
}),
/* ... */
},
}),
/* ... */
},
/* ... */
});

On this page

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /