Condividi tramite


IPartitionResolver Interface

Definition

Caution

Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.

This represents a partition resolver for a database. Given a partition key, return the collection link(s) matching the partition key in the Azure Cosmos DB service.

[System.Obsolete("Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.")]
public interface IPartitionResolver
[<System.Obsolete("Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.")>]
type IPartitionResolver = interface
Public Interface IPartitionResolver
Derived
Attributes

Remarks

Support for IPartitionResolver is now obsolete. It's recommended that you use Partitioned Collections for higher storage and throughput.

DocumentClient allows you to create and register IPartitionResolvers implementations for each database. Once registered, you can perform document operations directly against a database instead of a collection. IPartitionResolvers has just three methods ExtractPartitionKey, ResolveForCreate and ResolveForRead.

LINQ queries and ReadFeed iterators use the ResolveForRead internally to iterate over all the collections that match the partition key for the request. Similarly, create operations use the ResolveForCreate to route creates to the right partition. There are no changes required for Replace, Delete and Read since they use the Document, which already contains the reference to the collection that holds the document.

Methods

GetPartitionKey(Object)

Extracts the partition key from a document in the Azure Cosmos DB service.

ResolveForCreate(Object)

Given a partition key, this returns the collection self-link for creating a document in the Azure Cosmos DB service.

ResolveForRead(Object)

Given a partition key, this returns a list of collection self-links to read from.

Applies to