concept attribute in category sails

appears as: ttributes, The attributes, attributes, n attribute, ttribute, attribute
Sails.js in Action

This is an excerpt from Manning's book Sails.js in Action.

Figure 1.10. The components of a model include attributes, methods, and settings.
Figure 1.10. The components of a model include attributes, methods, and settings.

The attributes describe the properties of each user record that the database will be tasked with managing—in this case, username, email, and password.

Your first attribute validation is a requirement for both the email and username attributes to be unique. That means no record can contain an identical email or username in the database. If an attempt is made to create or update a record using a model method with an identical attribute, the method will produce an error. The unique validation is different than other validations. Imagine you have one million user records in your database. If unique was implemented like other validations, every time a new user signed up for your app, Sails would need to search through one million existing records to ensure that no one else was already using the email address provided by the new user. Not only would that be slow, but by the time it finished searching through all those records, someone else could have signed up!

Example 13.25. Configured followers and following attributes in the user model
...
// Who is following me?
followers: {
  collection: 'user',
  via: 'following'
},

// Who am I following?
following: {
  collection: 'user',
  via: 'followers'
},
...