Hi, @Lisha Tawar Welcome to the Microsoft Q&A platform, thanks for posting the question
If I understand correctly you want to delete the container using a single query in Cosmodb NOSQL API
Which Java client are you using? check this document on Java SDK and sample code on github
however, you should be able to configure the TTL from the Portal the best ways is to delete & recreate the container, or set the TTL to 0 , or do a SELECT * and then iterate through each result, get the ID and delete with the method posted here
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-time-to-live?tabs=dotnet-sdk-v3
You go to the container that you need, Set the TTL to 1 second and all documents that are older than 1 second will get deleted from the container
I hope this information helps.
Regards
Geetha