3 ms·
I really like Sequelize after using it in a couple of small projects. Not quite that level of concise, but I find it to be a really nice balance of concision an
by ketzo 8y ago
I really like Sequelize after using it in a couple of small projects. Not quite that level of concise, but I find it to be a really nice balance of concision and flexibility.
Person.findOne({where: {name: "Grandma L."}})
Person.findAll({where: {age: 30}})
Particularly, I really like how associations are handled. If I have a one-to-many association between Posts and Comments, I can do something like this:
Post.findOne({where: {title: "My Article}})
.then( article => {
article.getComments()
.then( comments => {
// do something with all comments of Post "My Article"
});
});
http://docs.sequelizejs.com/manual/ http://docs.sequelizejs.com/manual/