How do we get total records while using limit and skip ?
I have a query which does a bunch of matches. How do i return the total number of records matched ? Do I have to write a seperate query for that ?
How do we get total records while using limit and skip ?
I have a query which does a bunch of matches. How do i return the total number of records matched ? Do I have to write a seperate query for that ?
You could collect the results, get the size of the collection, then unwind if you want rows. You can append the count to each row.