@@ -5,7 +5,7 @@ As there are often use cases in which it is just easier to execute raw / already
By default the function will return two arguments - a results array, and an object containing metadata (affected rows etc.). Note that since this is a raw query, the metadata (property names etc.) is dialect specific. Some dialects return the metadata "within" the results object (as properties on an array). However, two arguments will always be returned, but for MSSQL and MySQL it will be two references to the same object.
```js
sequelize.query("UPDATE users SET y = 42 WHERE x = 12").spread((results,metadata)=>{
sequelize.query("UPDATE users SET y = 42 WHERE x = 12").then(([results,metadata])=>{
// Results will be an empty array and metadata will contain the number of affected rows.
When invoking several scopes, keys from subsequent scopes will overwrite previous ones (similar to [_.assign](https://lodash.com/docs#assign)). Consider two scopes:
When invoking several scopes, keys from subsequent scopes will overwrite previous ones (similar to [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign). Consider two scopes:
* Execute a query on the DB, with the possibility to bypass all the sequelize goodness.
*
* By default, the function will return two arguments: an array of results, and a metadata object, containing number of affected rows etc. Use `.spread` to access the results.
* By default, the function will return two arguments: an array of results, and a metadata object, containing number of affected rows etc.
*
* If you are running a type of query where you don't need the metadata, for example a `SELECT` query, you can pass in a query type to make sequelize format the results: