Data Collection Spec
Data Collection Spec describes Data Records in the collection and how to manipulate them: create, read, update, delete, or subscribe to updates.
Data Collection Spec looks like this:
# Says that this is a collection and not another type of Data Location
type: collection
​
# How this collection's name should be displayed in the UI.
name: Users
​
# Data Schema with all the possible collection fields.
# Each operation below can use a subset of fields from this schema.
fieldsSchema:
type: object
properties:
name:
type: string
email:
type: string
# Specification for Find operation.
find:
# List of fields that can be used to query records in this collection fast,
# i.e. without listing all the records in the collection.
queryFields: ['email']
# This collection supports `find by id` operation.
findById: true
​
create:
# Subset of fields from `fieldsSchema` that can be used
# when creating a new record
fields: ['name', 'email']
# Fields required to create a new record
requiredFields: ['email']
update:
# Subset of `fieldsSchema` that can be updated.
fields: ['name']
# This collection supports "delete" operation.
delete: true
​
Copy link