Cosmos DB Connector
Documentation
Version: 2
Documentation
Endpoint

Get Document by Id


Name

get_document

Description

Gets Document by Id. [API reference]

Related Tables

[Dynamic Table]

Parameters

Parameter Label Required Options Description
Id Document Id YES
Table Table Name (Case-Sensitive) YES
Database Database Name (keep blank to use default) Case-Sensitive NO Leave blank to use default DB set on connection screen
EnableCrossPartition EnableCrossPartition NO
Option Value
true true
false false
PartitionKey Partition Key Value (default is supplied Id) NO
Option Value
Default .
SingleKeyValue ["someValue1"]
MultiKeyValue ["some_value1","some_value2" ]
The partition key value for the document. Must be included if and only if the collection is created with a partitionKey definition
ConsistencyLevel ConsistencyLevel NO
Option Value
Strong Strong
Bounded Bounded
Session Session
Eventual Eventual
This is the consistency level override. The valid values are: Strong, Bounded, Session, or Eventual (in order of strongest to weakest). The override must be the same or weaker than the account's configured consistency level.

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Raw Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.
If the column you are looking for is missing, consider customizing Cosmos DB Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Raw Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use Cosmos DB Connector in API Source component to read data or in API Destination component to read/write data:

Lookup a row in [Dynamic Table] table using API Destination

This Endpoint belongs to [Dynamic Table] table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

Cosmos DB
[Dynamic Table]
Lookup
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Get document by id

SELECT * FROM get_document
WHERE Id = 'abcd-1234-id'
WITH
(
    "Table" = 'abcd-1234-table'
)

get_document endpoint belongs to [Dynamic Table] table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Get document by id

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM get_document
WHERE Id = ''abcd-1234-id''
WITH
(
    "Table" = ''abcd-1234-table''
)';

EXEC (@MyQuery) AT [LS_TO_COSMOS_DB_IN_GATEWAY];

get_document endpoint belongs to [Dynamic Table] table(s), and can therefore be used via those table(s).