The collection or collections can be deleted by doing the same from the portal as well as from the code by using .Net SDK.
Step 1 : On Azure portal go to DocumentDB account. The two more collections are added to show the demo as shown in the following figure.
Step 2 : Click on that collection which you want to delete. Select TempCollection1. The following page will be displayed, select the ‘Delete Collection’ option.
Step 3 : The confirmation message will be displayed. Now click ‘Yes’ button.
From the above figure you can see that, the TempCollection1 is not available on your dashboard.
The collections can also be deleted from your code using .Net SDK. To do these follow the steps.
Step 1 : By specifying the ID of the collection you can delete the collection which you want to delete.
It's the usual pattern of querying by Id to obtain the selfLinks needed to delete a resource.
Step 2 : Run the query and its SelfLink is used to delete the collection from the CreateDocumentClient task.
The complete implementation of Program.cs files as follows.
On compiling and executing the above code the following result is produced:
DocumentDB Related Interview Questions
|DB2 Using SQL Interview Questions||Dbase Interview Questions|
|DB2 SQL Programming Interview Questions||Document Type Definition (DTD) Interview Questions|
|CouchDB Interview Questions||DB 400 Interview Questions|
|Documentum Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.