[C#][COSMOS SDK V3] Get item from container without partition key

sravan kumar 121 Reputation points
2021-02-19T11:26:03.873+00:00

Hi,

How to get item from cosmos DB using SDK v3 with out providing partition key, its giving below error

Thanks,
Sravan kumar

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,505 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,528 questions
{count} votes

Accepted answer
  1. sravan kumar 121 Reputation points
    2021-02-20T21:17:06.633+00:00

    able to find the answer :

    we have to pass "PartitionKey.None" in the place of partition key.

    example:
    var document = await container.ReadItemAsync<JObject>(iD, PartitionKey.None);

    Thanks,
    Sravan kumar

    0 comments No comments

0 additional answers

Sort by: Most helpful