I will have to sort data in mongodb sort data by pagination – Javascript
I will have to sort data by data and acccording to the pagination. This is the query which I used response.data = await distributorDoc.find().sort({"TimeStamp":-1,}); It is the pagination pagination: { totalCount: 0, pageCount: 0, currentPage: page, perPage: reqData.perPage || perPageCount…