JSON object requested, multiple (or no) rows returned #3343
-
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.
Replies: 2 comments 2 replies
-
I know this is happens cuze of |
Beta Was this translation helpful? Give feedback.
-
Unrelated answer, but I ended up with the same error message when looking for a tri-state boolean value with Postgres expects Changing the query to |
Beta Was this translation helpful? Give feedback.
I know this is happens cuze of
.single()
behaviour. For the moment i replaced.single()
with.limit(1)
.