Table of Contents

Class ChangeFeedOptions

Namespace
Microsoft.Azure.Documents.Client
Assembly
Microsoft.Azure.Documents.Client.dll

Specifies the options associated with change feed methods (enumeration operations) in the Azure Cosmos DB service.

public sealed class ChangeFeedOptions
Inheritance
ChangeFeedOptions
Inherited Members
Extension Methods

Constructors

ChangeFeedOptions()

public ChangeFeedOptions()

Properties

MaxItemCount

Gets or sets the maximum number of items to be returned in the enumeration operation in the Azure Cosmos DB service.

public int? MaxItemCount { get; set; }

Property Value

int?

The maximum number of items to be returned in the enumeration operation.

Remarks

Used for query pagination. '-1' Used for dynamic page size.

PartitionKey

Gets or sets the partition key for the current request in the Azure Cosmos DB service.

public PartitionKey PartitionKey { get; set; }

Property Value

PartitionKey

Examples

var options = new ChangeFeedOptions() { PartitionKey = new PartitionKey("c7580115-8f46-4ac4-a0c7-22eae9aaabf1"), StartFromBeginning = true };

Remarks

PartitionKey cannot be specified along with PartitionKeyRangeId.

PartitionKeyRangeId

Gets or sets the partition key range id for the current request in the Azure Cosmos DB service.

public string PartitionKeyRangeId { get; set; }

Property Value

string

Remarks

ChangeFeed requests can be executed against specific partition key ranges. This is used to process the change feed in parallel across multiple consumers. PartitionKeyRangeId cannot be specified along with PartitionKey.

RequestContinuation

Gets or sets the request continuation token in the Azure Cosmos DB service.

public string RequestContinuation { get; set; }

Property Value

string

The request continuation token.

SessionToken

Gets or sets the session token for use with session consistency in the Azure Cosmos DB service.

public string SessionToken { get; set; }

Property Value

string

The session token for use with session consistency.

Remarks

Useful for applications that are load balanced across multiple Microsoft.Azure.Documents.Client.DocumentClient instances. In this case, round-trip the token from end user to the application and then back to Azure Cosmos DB so that a session can be preserved across servers.

StartFromBeginning

Gets or sets whether change feed in the Azure Cosmos DB service should start from beginning (true) or from current (false). By default it's start from current (false).

public bool StartFromBeginning { get; set; }

Property Value

bool

StartTime

Gets or sets the time (exclusive) to start looking for changes after. If this is specified, StartFromBeginning is ignored.

public DateTime? StartTime { get; set; }

Property Value

DateTime?