I have a query that fetches 10k documents and every document has a dbref to another document. This query takes ~5 seconds to run and is unacceptable. During debug and logging i've spotted that mongo driver makes a round trip to database for every DbRef.
My DbRef documents are the same for the most part of primary documents. I would like to use a cache for this and don't make additional round trips to mongo for every document.
The question is : could DbRefs be cached while executing primary query?