You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing Complex Filters in Reactive Model Disrupts Pagination and IndexedDB Query Logic
Hello Reactive Model Team 🤙
I've encountered an issue while trying to enhance the client-side Reactive Model with additional filter functionalities,
specifically aiming to integrate complex filters like OR, between, startsWith, etc., while preserving the existing
pagination and filtering features.
Issue Description:
Functionality Added: An implementation to handle OR operations in filters:
This function successfully handles filters using the OR operator. However, it requires multiple Dexie queries, which
diverges from the original functionality that uses a single IndexedDB request for pagination.
where=(params,limit)=>{// ... Previous codeconstcollection=Object.keys(specs).length===0 ? store : (store.where(specs)asunknown);letquery=collectionasCollection;this.#currentLimit =limit;this.#currentOffset =offset;if(sortBy)awaitquery.sortBy(sortBy);query=query.filter(i=>i.isDeleted!==1);constvalues=awaitquery.offset(offset).limit(limit).toArray();returnvalues;};
The challenge is integrating this new OR filter logic without disrupting the existing pagination strategy, which is
reliant on a single IndexedDB request. The current approach of handling multiple Dexie queries for complex filters like
OR, between, startsWith, etc., significantly alters the pagination logic, leading to potential incompatibilities and
errors.
Additional Context:
This issue is not limited to the OR operator. Similar challenges arise with other Dexie use cases like between, startsWith, below, and above.
Implementing Complex Filters in Reactive Model Disrupts Pagination and IndexedDB Query Logic
Hello Reactive Model Team 🤙
I've encountered an issue while trying to enhance the client-side Reactive Model with additional filter functionalities,
specifically aiming to integrate complex filters like OR, between, startsWith, etc., while preserving the existing
pagination and filtering features.
Issue Description:
This function successfully handles filters using the OR operator. However, it requires multiple Dexie queries, which
diverges from the original functionality that uses a single IndexedDB request for pagination.
File Location:
library\modules\entities\collection\local-provider\loader.ts
Original Functionality for Comparison:
The challenge is integrating this new OR filter logic without disrupting the existing pagination strategy, which is
reliant on a single IndexedDB request. The current approach of handling multiple Dexie queries for complex filters like
OR, between, startsWith, etc., significantly alters the pagination logic, leading to potential incompatibilities and
errors.
Additional Context:
between
,startsWith
,below
, andabove
.between
,startsWith
,below
,above
Seeking Guidance:
existing pagination logic?
I appreciate any insights or suggestions you might have on this matter.
Best regards, Bryant Caballero
The text was updated successfully, but these errors were encountered: