Many thanks for your help. I found a solution, although this is not quite what I am looking for, but it works, and is also still good.
The sequelize object has a .get() method to return the version of a simple object. So it looks something like this:
Model.create(modelObject) .then((resultEntity) => { const dataObj = resultEntity.get({plain:true}) }
From this topic: Sequelize, convert an object to a simple object . Look at CharlesA's answer.
Did not try to use arrays, but check its comments and the answer next to it if you have problems with the array of results. But since .create() only returns an object, it works for me. In any case, if you use .findAll() , you should use the {raw: true} option instead, because it works in this method.
PS If someone else has a solution in which Sequelize itself will not return this large resultEntity object, but simply a simple data object, like the {raw: true} option (because I think it's still easier?), We are open.
Many thanks.
source share