Hi Arootin, Thanks for responding. It is good to hear if my work helped anyone.
Coming to $facet query,I did not know about it .But when I read the documentation ,I feel that we should not use $facet query. Because for our specific example here,we just need to know what are the total records in the database to show a string to the user “ Showing 50 records out of 1000 records” .In case of facet query all 1000 records are pulled out isnt it .That would be such a performance hit.
Let me know if you have used $facet query and came out with a solution . Post it here for everyone’s understanding.