Fixes #6302 --------- Co-authored-by: martmull <martmull@hotmail.fr>
Fixes #6405 We need to take into account both the totalCount of **before cursor** results and **after cursor** results.