Return an empty MongoDB page for a zero result limit

This commit is contained in:
Andras Schmelczer 2026-10-27 19:56:43 +00:00
commit 63825de2f9

View file

@ -143,6 +143,8 @@ class MongoDbDriver(TracingDatabaseDriver):
with MongoClient[Any](self.mongo_connection_string) as client:
count = client[self.mongo_database].traces.count_documents(**query)
if take == 0:
return [], count
if skip:
query["skip"] = skip