SupabaseS
Supabase4y ago
greg

How do I query JSON ?

When I guery a JSON filled column, I get the object like on top of the screen.

What I would like is the same as at the bottom (a real json object).

My function:
    const fetchPlayers = async () => {
      const { data, error } = await supabase
      .from('export')
      .select('data')
      .limit(1)
      .order('inserted_at', { ascending: false })

      if (error) {
        setFetchError('Could not fetch')
        setPlayers(null)
        console.log(error)
      }
      if (data) {
        console.log(data)
        console.log(jsonB)
        setPlayers(data)
        setFetchError(null)
      }
    }
unknown.png
Was this page helpful?