visible

The primary key of the model will always be added to the visible list so the record can still be find.

Usage

class User extends Model {
  static entity = 'users'
  
  // only return fields "name" and "phone" for this model by default
  static visible = ['name', 'phone']
  static fields () {
    return {
      id: this.uid(),
      name: this.string(''),
      phone: this.number(0),
      secret: this.string('')
    }
  }
}

Typescript Declarations

const visible: string[] = []