Number array parameter parsed as string array
See original GitHub issueI am not able to use an array of numbers as a parameter
var keep = [1, 2, 3]
// this does not work
client.query('delete from foo where key_one=$1 and key_two not in($2)', [id, keep], function(err, result) {
// handle result
})
gives this error
invalid input syntax for integer: "{"1","2","3"}"
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
why does javascript parse an array as a string when passed in ...
When two numbers are added, an integer is output. However, 2 and hello can't be added numerically, so everything is first automatically ...
Read more >Array[number] query params is NOT correctly parsed. #5793
Description. Parsing array value from argument decorated by @param. array() has bug, it doesn't respect the item type specified for each item.
Read more >Passing arrays as arguments - C# Programming Guide
Arrays can be passed as arguments to method parameters. Because arrays are reference types, the method can change the value of the elements....
Read more >parse_str - Manual - PHP
Parses string as if it were the query string passed via a URL and sets variables in the current scope (or in the...
Read more >How to Parse a Query string Array Parameter using - Apigee
Is there any particular query parameter format I must use in the GET runstring but it appears I am unable to parse an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@camsteffen you mean is replacing
field IN (<array_of_int>)
byfield = ANY(<array_of_int>)
is what makes it work? Very subtle. Thank you 😃I figured it out. My query was formed wrong but it is actually possible to use a number array as a parameter.