© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
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)
      }
    }
    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
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how do I use recursive query?
SupabaseSSupabase / help-and-questions
3y ago
Query JSON Column
SupabaseSSupabase / help-and-questions
4y ago
How can I query this
SupabaseSSupabase / help-and-questions
3y ago
Query data in jsonb values array
SupabaseSSupabase / help-and-questions
4y ago