The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Sequelize: Class & Instance Methods

Sequelize: Class & Instance Methods

2:32
Models in the Node.js ORM, Sequelize, can be expanded with both class level and instance level functions. This video will show you how to extend your models to add helpers or business logic, and explain the methods execution scope.
Watch this lesson now
Avatar
egghead.io

Models in the Node.js ORM, Sequelize, can be expanded with both class level and instance level functions. This video will show you how to extend your models to add helpers or business logic, and explain the methods execution scope.

Avatar
Prith

implementation wise, what's the difference between class methods and instance methods? As in, in what scenarios will we be using each of them?

Avatar
Mike

Generally, if you want to act on a single instance, you'd create an instance method. If you want to act on multiple instances, such as, a method for helping query the database, you'd create a class method.

In reply to Prith
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?