How to pass array of objects in replacement #14543
Answered
by
ephys
rohitpatil7892
asked this question in
Help & Questions
-
I want to pass an array of objects into replacement
I want this to improve my performance, Can you please help me to resolve this or open for better suggestions Thanks in advance :)
|
Beta Was this translation helpful? Give feedback.
Answered by
ephys
May 24, 2022
Replies: 1 comment
-
Try this: const result = await sequelize.query('SELECT id FROM `testTable` WHERE (name, version) IN (:data)', {
replacements: [
['test1', 1],
['test2', 2],
],
// ... other options
}); It should produce this query: SELECT id FROM `testTable` WHERE (name, version) IN (('test1', 1), ('test2', 2)) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rohitpatil7892
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this:
It should produce this query: