Array validations
required: can't be undefined (default:false)sparse: can have undefined items (default:true)unique: can't have duplicate items (default:false)minLength: minimum quantity of itemsmaxLength: maximum quantity of itemsexactLength: exact quantity of items
const Group = attributes({
members: {
type: Array,
itemType: String,
minLength: 2,
maxLength: 5,
sparse: false,
unique: true
},
leaders: {
type: Array,
itemType: String,
minLength: 1,
maxLength: { attr: 'members' }
}
})Last updated
Was this helpful?