Skip to content

Commit

Permalink
Merge pull request #121 from knaw-huc/117-w3c-container-endpoint-opti…
Browse files Browse the repository at this point in the history
…maliseren

user estimatedDocumentCount, as it is faster; fixes #117
  • Loading branch information
brambg committed Feb 2, 2024
2 parents 4fc462c + d070c44 commit bbe372d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class W3CResource(
val metadata = containerMetadataCollection.findOne(Document(CONTAINER_NAME_FIELD, containerName)) ?: return null
val collection = containerDAO.getCollection(containerName)
val uri = uriFactory.containerURL(containerName)
val count = collection.countDocuments()
val count = collection.estimatedDocumentCount()
val annotations = collection.aggregate<Document>(
Aggregates.match(
Filters.exists(ANNOTATION_FIELD)
Expand Down

0 comments on commit bbe372d

Please sign in to comment.