I have a product document in mongodb. I am retrieving data with paging using skip and limit after filtering and sorting, like this using mongoose -
Product.find({gender:'male'})
.sort(price: 1)
.skip(page * 25).limit(25);
When page value is 0 it returns the result as expected, but when the page value changes to 1 it returns some results that were already retrieved when page value was 0. I am passing all these parameters through query in nodjs express. How can i retrieve unique value only with sorting and filtering while using pagination with mongoose ?