_id
value.
This design enables TopK to scale a single collection efficiently without performance degradation by leveraging smart sharding by document ID.
This approach still enables you to query across all tenants if needed.
Storing documents for a specific tenant
To store documents for a specific tenant, prepend the tenant ID to the document_id
value:
Querying documents for a specific tenant
To query documents for a specific tenant, use the tenant ID along with thestartsWith()
filter: