Creates a new instance of a field
The collection this field is attached to
The display hints specified for this field
Whether or not the field handles large data
the name of the field
Whether or not this field should always have a value. Creating a resource with a value missing for a required field will throw an error
Reverse to the Field.encode function. Takes what's inside the database and returns the value in a given format
Generates a mongo query based on the filter value
Whether or not the db should create a fulltext index on this field
Creates parts of a Mongo Pipieline that will be used to filter the items when listing items of a collection
If the field supports attachments, it should return a properly configured AttachmentLoader. Not necessary for most basic fields.
The default value that will be assigned to the field if no value is given
Return a summary of this field
Value path is where inside a single record should the DB look for the field's value when filtering resources. Some fields use complex objects for storage and overwrite this method, and thanks to that they don't have to reimplement Field.getAggregationStages
Whether or not a field has a default value - that is, a value given to the field if no value is provided
Whether or not this field should have a dedicated index in the database
Runs when the app is being started. Hooks can be set up within this function
Whether or not any of the methods of the field depend on the previous value of the field
This method is used to set and process the params upon the field's creation when the app starts up. The type of argument of this method determines type checking that's performed by @{link FieldDefinitionHelper}.
Create a new instance of Field based on the definition. **It's recommended to use FieldDefinitionHelper instead
Used to signal a negative decition from within Field.isProperValue.
Used to signal a positive decision from within Field.isProperValue.
Generated using TypeDoc
The field class itself. Stores information on the field name, and methods that decide waht values are valid and how they are stored. The Field class describes a type of field in general (like "Text" and "Number"), and a Field instance describes one particular field in a collection (like "name" and "age").
Extend this class to create fields with custom behavior.
The recommended way to create a field for a collection is FieldDefinitionHelper, as it performs type checking of the field params.
Some of the most useful field types include: