From 2537f8aa9a907f2d24b5b048a91c7ba58f4e2cbc Mon Sep 17 00:00:00 2001 From: KillianG Date: Fri, 10 Nov 2023 19:23:42 +0100 Subject: [PATCH] Exclude location field from search query in MongoReadStream. Issue: ARSN-372 --- lib/storage/metadata/mongoclient/readStream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/storage/metadata/mongoclient/readStream.js b/lib/storage/metadata/mongoclient/readStream.js index 3ff54f3e1..97a697bbe 100644 --- a/lib/storage/metadata/mongoclient/readStream.js +++ b/lib/storage/metadata/mongoclient/readStream.js @@ -85,7 +85,8 @@ class MongoReadStream extends Readable { Object.assign(query, searchOptions); } - this._cursor = c.find(query).sort({ + const projection = { 'value.location': 0 }; + this._cursor = c.find(query, { projection }).sort({ _id: options.reverse ? -1 : 1, }); if (options.limit && options.limit !== -1) {