0

I'm working with Azure Cosmos DB, and I need to fetch all the documents of a particular collection of database. So that for executing a stored procedure they ask to enter partition key value, but I need the query result without any filter.

How can I create a collection for a particular database without mentioning the partition key? I'm accessing Cosmos DB in https://portal.azure.com/. I have to create a collection from that UI itself, not from code.

karel
  • 5,489
  • 46
  • 45
  • 50
Rijitha T.J
  • 51
  • 1
  • 7

1 Answers1

1

Firstly,about stored procedure execution needs partition key.You could find the below clear statements in the link:

If a stored procedure is associated with an Azure Cosmos container, then the stored procedure is executed in the transaction scope of a logical partition key. Each stored procedure execution must include a logical partition key value that corresponds to the scope of the transaction. For more information, see Azure Cosmos DB partitioning article.

Secondly,in the past,you could create non-partitioned collection on the portal.But now, you can't.Please see my previous case:Is it still a good idea to create comos db collection without partition key?. Based on your description,you don't want partitioned collection.So, please create non-partitioned collection by Cosmos DB SDK. Such as:

DocumentCollection collection = new DocumentCollection();
collection.set("id","jay");
ResourceResponse<DocumentCollection> createColl = client.createCollection("dbs/db",collection,null);
Jay Gong
  • 23,163
  • 2
  • 27
  • 32