Class PartitionKey
Represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.
public sealed class PartitionKey
- Inheritance
-
PartitionKey
- Inherited Members
- Extension Methods
Constructors
PartitionKey(object)
Instantiate a new instance of the PartitionKey object.
public PartitionKey(object keyValue)
Parameters
keyValueobjectThe value of the document property that is specified as the partition key when a collection is created.
Remarks
This class represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.
Fields
SystemKeyName
The tag name to use in the documents for specifying a partition key value when inserting such documents into a migrated collection
public const string SystemKeyName = "_partitionKey"
Field Value
SystemKeyPath
The partition key path in the collection definition for migrated collections
public const string SystemKeyPath = "/_partitionKey"
Field Value
Properties
None
Instantiates a new instance of the PartitionKey object.
public static PartitionKey None { get; }
Property Value
Remarks
The returned object represents a partition key value that allows creating and accessing documents without a value for partition key
Methods
Equals(object)
Overrides the Equal operator for object comparisons between two instances of PartitionKey.
public override bool Equals(object other)
Parameters
otherobjectThe object to compare with.
Returns
- bool
True if two object instance are considered equal.
Remarks
This class represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.
FromJsonString(string)
Instantiate a new instance of the PartitionKey object.
public static PartitionKey FromJsonString(string keyValue)
Parameters
keyValuestringThe value of the document property that is specified as the partition key when a collection is created, in serialized JSON form.
Returns
Remarks
This class represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.
GetHashCode()
Hash function to return the hash code for the object.
public override int GetHashCode()
Returns
- int
The hash code for this PartitionKey instance
Remarks
This class represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.
ToString()
Override the base ToString method to output the value of each key component, separated by a space.
public override string ToString()
Returns
- string
The string representation of all the key component values.
Remarks
This class represents a partition key value that identifies the target partition of a collection in the Azure Cosmos DB service.