Skip to content

Conversation

bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented Jul 28, 2025

Similarly to how Python's "collection" object has __len__ override, CollectionHandle will have .size() to retrieve collection size idiomatically.

var things = client.collections.use("Things");
System.out.printf("Collection Things has %d elements", things.size());

The -async version of this method is non-blocking.

resolves #423

@bevzzz bevzzz requested a review from Dabz July 28, 2025 09:52
@bevzzz bevzzz self-assigned this Jul 28, 2025
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@bevzzz bevzzz linked an issue Jul 28, 2025 that may be closed by this pull request
@bevzzz bevzzz merged commit b0219de into v6 Jul 28, 2025
2 checks passed
@bevzzz bevzzz deleted the v6-collection-size-shortcut branch July 28, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v6: Add shortcut for querying total collection size
2 participants