根据条件通过查询资源管理器从CosmosDB删除文档 [英] Delete Documents from CosmosDB based on condition through Query Explorer
问题描述
删除集合中符合条件的所有文档的查询或其他快速方法是什么?
我想要类似DELETE * FROM c WHERE c.DocumentType = 'EULA'
之类的东西,但是显然不起作用.
What's the query or some other quick way to delete all the documents matching the where condition in a collection?
I want something like DELETE * FROM c WHERE c.DocumentType = 'EULA'
but, apparently, it doesn't work.
注意:我没有为此寻找任何C#实现.
Note: I'm not looking for any C# implementation for this.
推荐答案
我想要类似DELETE * FROM c WHERE c.DocumentType ='EULA'的东西 但是,显然,它不起作用.
I want something like DELETE * FROM c WHERE c.DocumentType = 'EULA' but, apparently, it doesn't work.
不支持以此方式删除文档.您首先需要使用SELECT查询选择文档,然后分别删除它们.如果需要,您可以编写代码以获取&删除存储过程,然后执行该存储过程.
Deleting documents this way is not supported. You would need to first select the documents using a SELECT query and then delete them separately. If you want, you can write the code for fetching & deleting in a stored procedure and then execute that stored procedure.
这篇关于根据条件通过查询资源管理器从CosmosDB删除文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!