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);


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

lineItems->>condition.eq.new
Was this page helpful?