Skip to content

How to overcome the array-contain's 10 max limit  #139

@rodbs

Description

@rodbs

To overcome the array-contain's 10 max limit, would it be possible to implement a kind of pagination?

My uses case is that I want to pre-filter the collection before doing an actual filtering. I have a 'items' collection, and each user has myFavItems. I want each user to do be able to filter the 'items' collection but only for his/her items. Example: For user A, it has 20 entries in his myFavItems. I want to go against the 'items' collection and filter by 'blue' items, but only within the scope of his 20 items.

So ideally I'd like to do something like:

const myFavItems = [ 1,2, ... 20] 

const { data  } = useCollection(    'items',
   {
     where: ['id', 'in', myFavItems ]
     where: ['color', 'array-contains', myColor],
 
   },

The problem is the first filter is limited to 10.

So, any ideas? What about to create a moving window to query for 10 items each time?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions