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
At this moment, we can get document from data contract using limit and startAt/startAfter
But startAt and startAfter only get Identifiers, which makes it impossible to paginate documents adequately
Also we dont have totalCount for documents
Expected Behavior
startAt and startAfter must get integers, because otherwise we need to create many requests for any page
Exmaple with limit 50 and page 10:
Create first and last request with limit 50 and startAfter equal 50*9
Current Behavior
As example we have limit 50, page 10, and the alghoritm to get it is:
Create first request with limit 100 and empty startAfter
Create second request with limit 100 and startAfter equal last identifier of document from previous request
Create second request with limit 100 and startAfter equal last identifier of document from previous request
Create second request with limit 100 and startAfter equal last identifier of document from previous request
Create second request with limit 50 and startAfter equal last identifier of document from previous request
Possible Solution
Replacing type for startAt and startAfter from identifier to integer on sever side and in clients and adding totalCount
The text was updated successfully, but these errors were encountered:
totalCount sadly is not a capability of the current system, as it's impossible to prove the total amount without a node count. Such a feature would be possible by making a automatic count feature in grovedb, however it just hasn't been done yet.
The system is not designed to paginate integers either. This is because the underlying data might change, and you might miss values.
At this moment, we can get document from data contract using
limit
andstartAt
/startAfter
But
startAt
andstartAfter
only get Identifiers, which makes it impossible to paginate documents adequatelyAlso we dont have
totalCount
for documentsExpected Behavior
startAt
andstartAfter
must get integers, because otherwise we need to create many requests for any pageExmaple with limit 50 and page 10:
limit
50 andstartAfter
equal 50*9Current Behavior
As example we have limit 50, page 10, and the alghoritm to get it is:
limit
100 and emptystartAfter
limit
100 andstartAfter
equal last identifier of document from previous requestlimit
100 andstartAfter
equal last identifier of document from previous requestlimit
100 andstartAfter
equal last identifier of document from previous requestlimit
50 andstartAfter
equal last identifier of document from previous requestPossible Solution
Replacing type for
startAt
andstartAfter
from identifier to integer on sever side and in clients and addingtotalCount
The text was updated successfully, but these errors were encountered: