According to doc
if options.raw
If set to true, field and virtual setters will be ignored
But what is the meaning of field and virtual setters?
I have watched lots of sites but seem no examples for the format of query result when the value of options.raw is true/false.
Let say I have users model created in Sequelize
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;
const db = require('../sequelize')
let users = db.define('users', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
primaryKey: true
},
email: {
type: DataTypes.STRING,
allowNull: false,
unique: 'email'
},
password: {
type: DataTypes.STRING,
},
},
{
hooks: {
beforeCount(options) {
options.raw = true; // what would be the difference when I set it to false
}
}
}
);
users.sync().then(() => {
console.log('user table created');
});
module.exports = users;
What would be the difference when I set options.raw to false?
Any examples for it?