I have a query which has pagination, the query works fine and observes changes in database, but when i add pagination, it doesnot observe changes in entire data.
const conversations: Collection = database.collections.get(
TableName.CONVERSATION,
);
return conversations
.query(
Q.where('status', statusQuery),
Q.or(
Q.where('customer_name', Q.like(%${searchText}%)),
Q.where('customer_contact', Q.like(%${searchText}%)),
),
Q.sortBy('modified', Q.desc),
// Q.skip((offset - 1) limit),
// Q.take(offset limit),
)
.observeWithColumns(['modified']);
};
example if offset is 1 and limit is 50 it observers all 50 record,
but if page is 2 and limit in 50
, it doesnot observe changes in previous data
I have a query which has pagination, the query works fine and observes changes in database, but when i add pagination, it doesnot observe changes in entire data. const conversations: Collection = database.collections.get(
TableName.CONVERSATION,
);
export const observeConversation = ( offset = 1, searchText: string, status: string, limit = 50, ) => { console.log('offset ====> ', offset, (offset - 1) limit, offset limit); const statusQuery = status === 'closed' ? Q.eq('closed') : Q.oneOf(['open', 'assigned', 'unassigned']);
return conversations .query( Q.where('status', statusQuery), Q.or( Q.where('customer_name', Q.like(
%${searchText}%
)), Q.where('customer_contact', Q.like(%${searchText}%
)), ), Q.sortBy('modified', Q.desc), // Q.skip((offset - 1) limit), // Q.take(offset limit), ) .observeWithColumns(['modified']); }; example if offset is 1 and limit is 50 it observers all 50 record, but if page is 2 and limit in 50 , it doesnot observe changes in previous data