Short answer: you cannot get the list of collections inside the document. However, you can get a list of the collection inside the database.
Here's a look at the DocumentDB resource model: ![enter image description here](https://fooobar.com//img/950b74207b228bb970fce1ec66176a88.png)
A look at the DocumentDB resource model โ Databases contain collections, which in turn contain stored procedures, triggers, UDFs, and documents.
You can request a list of collections in a given database using the DocumentDB Client or the REST API. Here is an example in .NET:
DocumentClient client = new DocumentClient(new Uri(endpoint), authKey); Database database = client.CreateDatabaseQuery("SELECT * FROM d WHERE d.id = \"[YOUR_DATABASE_ID]\"").AsEnumerable().First(); List<DocumentCollection> collections = client.CreateDocumentCollectionQuery((String)database.SelfLink).ToList();
Literature:
DocumentDB Resource Model and Concepts
DocumentDB.NET Code Samples
source share