-
Notifications
You must be signed in to change notification settings - Fork 326
sql.json - filter parameter missing? #406
Answered
by
porsager
vitalyster
asked this question in
Q&A
-
JSON.stringify have second filter parameter, what about sql.json? Any different way to transform object before writing to the database?
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
porsager
Jun 24, 2022
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
-
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) `
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Answer selected by
porsager
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment