JSON object requested, multiple (or no) rows returned #3343
Answered
by
zakaria-chahboun
zakaria-chahboun
asked this question in
Questions
-
This is a part of my code: const {data, error} = await supabase
.from('test')
.select('question(question_title, answer(*))')
.eq('test_id', ID)
.single(); When i select a non existent value it's gives me this error message: {
"message": "JSON object requested, multiple (or no) rows returned",
"details": "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row"
} Whiteout any error number or just return a Null value! What is the solution? Thanks 💟 |
Beta Was this translation helpful? Give feedback.
Answered by
zakaria-chahboun
Sep 28, 2021
Replies: 1 comment 2 replies
-
I know this is happens cuze of |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
soedirgo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know this is happens cuze of
.single()
behaviour. For the moment i replaced.single()
with.limit(1)
.