© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
lewisd

Array of jsonb .or() not working

This is my current JS query:

      let query = supabase.rpc("search_listings", {
        search_query: searchQuery,
      });
      if (conditions.length > 0) {
        const string = conditions.reduce((string, currentCondition, index) => {
          return (string += `lineItems->>condition.eq.${currentCondition}${
            index < conditions.length - 1 ? "," : ""
          }`);
        }, "");
        query = query.or(string);
      }
      const { data } = await query.limit(10);
      let query = supabase.rpc("search_listings", {
        search_query: searchQuery,
      });
      if (conditions.length > 0) {
        const string = conditions.reduce((string, currentCondition, index) => {
          return (string += `lineItems->>condition.eq.${currentCondition}${
            index < conditions.length - 1 ? "," : ""
          }`);
        }, "");
        query = query.or(string);
      }
      const { data } = await query.limit(10);


It's currently not working when a condition is selected. If I
console.log
console.log
the
.or()
.or()
string, I get:

lineItems->>condition.eq.new
lineItems->>condition.eq.new
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

Query data in jsonb values array
SupabaseSSupabase / help-and-questions
4y ago
Unable to filter on jsonb array column
SupabaseSSupabase / help-and-questions
4y ago
Querying Multiple Keys of JSONB
SupabaseSSupabase / help-and-questions
4y ago
RPC custom function to add object to JSONB array?
SupabaseSSupabase / help-and-questions
4y ago