1

I have the following query:

let query = supabase
      .from("property_owners")
      .select(
        `id, full_name,  property(id), address(id, street, house_number, city, zipcode, property(id))`,
      );

Now, I want to find a way to either:

  • Sort the property owners by property count
  • Filter the property owners by property count (get all property owners with > 5 properties)

I can't seem to find a way to do this, is this a limit of supabase?

1
  • You can always use views or rpcs to perform complicated queries instead of directly using the Supabase client library. Commented May 14, 2024 at 5:32

1 Answer 1

0

you can user order to sort the returns list

let query = supabase
      .from("property_owners")
      .select()
      .order(columnName, ascending: true/false);

and for find rows that a perperty (numeric) is greater or lessser that a value use :
gt : greater than
gte : greater than or equal
lt : less than
lte : less that or equal

let query = supabase
      .from("property_owners")
      .select()
      .order(columnName, ascending: true/false)
      .gt(count, 5);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.