I am trying to rename documents in MongoDB using mangoid and manga gems. Unfortunately, I ran into a performance issue.
When I retrieve a collection of documents, and I want to get a specific version for each record, then every method call: entry.history_trackscalls 1 database query to a collection of history tracks. Therefore, when I have a collection of 100 records, I get 1 + 100 database queries.
Is there an easy way to fix this problem? I tried the method cache, but it does not solve the problem, since each request is different.
source
share