I am using aggregate and facets to implement paging using skip and limit.One facet is used to get the paged data and another facet is used to get total order count.
Db.collection.Aggregate.Match(filter).Facet(facet1,facet2);
When passing page number as 4 and page size as 500, I am getting the exception from mongo db server as pipeline limit exceeds 16mb.I also tried aggregate option allowdiskuse as true,but no use.Can anyone help me regarding it.