M
M
Maxim2021-06-04 13:41:10
Node.js
Maxim, 2021-06-04 13:41:10

How to separate column names from values ​​in a sequelize query?

Is it possible to separate column names from values ​​in a query using Sequelize?

For example, instead of this answer:

[
{ column1: 'value1', column2: 'value1', column3: 'value1',  },
{ column1: 'value2', column2: 'value2', column3: 'value2',  },
{ column1: 'value3', column2: 'value3', column3: 'value3',  },
]


Get something like this:
[
columns: [ column1, column2, column3 ],
values: [
[ 'value1', 'value1', 'value1',  ],
[ 'value2', 'value2', 'value2',  ],
[ 'value3', 'value1', 'value3',  ],
]
]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question