Extending, modifying, and deploying the schema
For the example used in this book, we will be creating a news and events website. The first step in this process is to create a file named event.js
in the document
directory, which will represent our event schema.
The event schema
The following code segment is the schema for an event, illustrating its various fields:
export default { Â Â name: 'event', Â Â type: 'document', Â Â title: 'Event', Â Â fields: [ Â Â Â Â { Â Â Â Â Â Â name: 'name', Â Â Â Â Â Â type: 'string', Â Â Â Â Â Â title: 'Name' Â Â Â Â }, Â Â Â Â { Â Â Â Â Â Â name: 'dateAndTime', Â Â Â Â Â Â type: 'datetime', Â Â Â Â Â Â title: 'Date and Time' Â ...