Lets say I have a collection of the following documents:
{
_id,
profile: {...},
arrayProp1: [....],
arrayProp2: [....],
arrayProp3: [....],
...
}
Number of objects in arrayPropX arrays may be become big, at least thousands. So I need to use pagination and the question is what is the best way to do this?
For example how to return:
- Total number of elements in arrayProp1 for specified _id
- X elements from position Y in arrayProp1 for specified _id ?
Same as above but with filter on some field on arrayProp1 elements?