Open
Description
Speed up proposal for method findManyByIds
.
apollo-datasource-mongodb/src/cache.js
Line 173 in 08e1c07
As-Is right now, it's opening a lot of findOneById
with a promise.all, but it's really inefficient once you have over 100 keys and it's slowing the UI.
While I don't exactly know how to implement this in the library exactly, the solution will look similar to this at the mongo level:
this.collection.find({ _id: { $in: arrIds } })
This will result in a single call to the server-side, speeding up for bigger queries.