@Bart Vandeputte The resolve plugin solves the problem of the router searching through all pages for the slug. However it does not address the problem of having to load everything when using the collections in a foreach loop, for example.
Loading a 1000 pages from an ssd drive is probably not problematic, but if you have something like a firestore collection of 500000 documents (where you pay for each read) you definitely don’t want to fetch all those docs only to show the “newest 10” in the panel.
So regardless of from where I access the collection, if I write:
it should load 0 docs.
If I write
it should load 1 doc, not all 500000
If I write
echo $mypages->filter('myvar', '==', 'uniqueval')->first()->name()
it should pass that filter, which could look something like this:
[ 'myvar', '==', 'uniqueval']
to a data handler (which, for example, was passed to the
Pages::factory function). Then that handler would probably do a query and return a single doc in a collection.
At the moment, only to “have” the
$mypages variable I need to load all 500000 docs