ConnectionMode Enumeration
Updated: June 30, 2017
Represents the connection mode to be used by the client when connecting to the Azure DocumentDB database service.
Assembly: Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)
| Member name | Description | |
|---|---|---|
| Direct | Uses direct connectivity to connect to the data nodes in the Azure DocumentDB database service. Use gateway only to initialize and cache logical addresses and refresh on updates | |
| Gateway | Use the DocumentDB gateway to route all requests to the Azure DocumentDB database service. The gateway proxies requests to the right data partition. | |
| IsDefined | Determines if a certain property is defined or not. (Defined by TypeCheckFunctionsExtensions.) | |
| IsNull | Determines if a certain property is null or not. (Defined by TypeCheckFunctionsExtensions.) | |
| IsPrimitive | Determines if a certain property is of premitive JSON type. (Defined by TypeCheckFunctionsExtensions.) |
Direct and Gateway connectivity modes are supported. Gateway is the default.
DocumentClient client = new DocumentClient(endpointUri, masterKey, new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct });