I have two collections, collectionA and collectionB and they are NOT related (i.e no 'foreign key' stuff). They represent two similar datasets, for arguments sake, let's say that collectionA is a collection of bird species, and collectionB of fish species
I need to query these both, but with skip and limit operators, so I need to concatenate the queries into one and apply skip and limit before the query is executed, because the collections have crazy volumes of data that will be frequently accessed, so the skip/limit is necessary, but I don't want the skip/limit to simply first reach over collectionA, and then reach into collectionB, I want them to access documents in the same increasing order as the timestamp in the _id's, so an example result might be
start = 3
limit = 2
bird.1 # skip
bird.2 # skip
fish.1 # skip
fish.2 # return this
fish.3 # return this
fish.4 # EOQ
bird.3
I'm fairly new to MongoDB so I apologize if this is unclear.
Here is an example JSON as per request. The collections are very similar, with only 1 field differing (I did not design this)
# collectionA
{
_id: ObjectId('507f1f77bcf86cd799439011'),
species: 'Falcon',
beak_type: 'hooked',
hates_fish: True
}
# collectionB
{
_id: ObjectId('507f1f77bcf86cd799439012'),
species: 'Haddock'
hates_fish: True
}