i want to get datavalues when iam using findAll() in sequelize without using raw:true
        Activities.findAll({
         include: [
         {       
           all: true         
          }   
         ],  
       })
        .then(activities => {   
        });
Without raw:true , you have to loop through each object and get value out of it that something like this :
Activities.findAll({
    include: [{
        all: true
    }],
}).then(activities => {
    return activities.map( activity => el.get({ plain: true }) );
});
OR
raw : true , produce the . name when include is used , that issue can be solved by nest : true
Activities.findAll({
    raw : true ,
    nest: true , // <--- The issue of raw true, will be solved by this
    include: [{
        all: true
    }],
}).then(activities => {
    console.log(activities);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With