0π
β
If you are always expecting only one value then you should be using .single()
along with that query. If however you are expecting zero to one row then you should use .maybeSingle()
. If you donβt use either of these methods then you will always get the data returned as an array.
const { data } = await supabase.from("count").select("aantal").maybeSingle();
0π
I used this it look better
async function getCountries() {
const { data } = await supabase
.from("numbers")
.select("aantal")
.limit(1)
.single();
countries.value = data.aantal;
console.log({ data });
}
Source:stackexchange.com