1sequelize.query("UPDATE users SET y = 42 WHERE x = 12").spread(function(results,
2 metadata) {
3 // Results will be an empty array and metadata will contain the number of
4 // affected rows.
5})
6
7/* In cases where you don't need to access the metadata you can pass in a query
8type to tell sequelize how to format the results. For example, for a simple
9select query you could do: */
10
11sequelize.query("SELECT * FROM `users`", { type: sequelize.QueryTypes.SELECT})
12 .then(function(users) {
13 // We don't need spread here, since only the results will be returned for
14 // select queries
15 })