0

I am using react admin and I have a view that contains a column which has a bunch of ids [1, 2, 3] and I have an id based on which I want to filter.

<List
    resource="view"

    filter={{
      ...(groupId && { [`group_ids.overlap`]: `{${groupId}}` }), 
    }}

so In the above I only want to see the records that have groupId in group_ids which comes from the view - does react admin support this? I am using supabase with react admin.

Thank you for your time.

1 Answer 1

1

Actually, supporting this kind of filter is neither the responsibility of react-admin (the filter object can be anything), nor Supabase (which simply hosts a Postgres database). What matters is the dataProvider + the API you are using.

With Supabase you are likely using ra-supabase, which uses internally ra-data-postgrest, which as the name implies uses the PostgREST dialect.

I believe the PostgREST filter operator you are looking for is cs (i.e. contains), so you probably need:

{ [`group_ids@cs`]: `{${groupId}}` }

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.