From 16a028944228e1aae25e2391c9419c84a646da98 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sat, 20 Jul 2024 13:16:11 +0200 Subject: [PATCH] possibly faster mongodb `exists` with count limit=1 --- src/main/scala/Mongo.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/Mongo.scala b/src/main/scala/Mongo.scala index 8673a3a3..09efd424 100644 --- a/src/main/scala/Mongo.scala +++ b/src/main/scala/Mongo.scala @@ -287,7 +287,7 @@ final class Mongo(config: Config)(using Executor) extends MongoHandlers: coll .count( selector = Some(selector), - limit = None, + limit = Some(1), skip = 0, hint = None, readConcern = ReadConcern.Local