From 73510ad7d5368ba8cb7021313da84195465e18c6 Mon Sep 17 00:00:00 2001 From: Leonardo Otoni Date: Thu, 11 Aug 2022 09:54:53 -0400 Subject: [PATCH] Force mongoose .lean() --- src/cache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.js b/src/cache.js index d36fdc6..5b6bbb4 100644 --- a/src/cache.js +++ b/src/cache.js @@ -135,7 +135,7 @@ export const createCachingMethods = ({ collection, model, cache }) => { log('filter: ', filter) const findPromise = model - ? model.find(filter).exec() + ? model.find(filter).lean() : collection.find(filter).toArray() const results = await findPromise