Skip to content

sql.json - filter parameter missing? #406

Answered by porsager
vitalyster asked this question in Q&A
Discussion options

You must be logged in to vote

sql.json isn't necessary for v3. Just use regular Javascript ;)

sql`
  insert into x (some_json) values (${
    someArray.filter(x => x.some_prop === 'wat')
  }::jsonb)
`

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by porsager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants