【发布时间】:2017-02-08 04:03:33
【问题描述】:
我需要以编程方式删除一堆文档。我可以使用 UI 中的 javascript“补丁”功能来查找这些文档,并添加一个属性来识别它们,如下所示:
if (__document_id.indexOf("baddata") > 0) {
this.'MakeThisGoAway' = true;
}
但我找不到删除“补丁”中文档的方法。 (我假设是设计的)
从 Raven 文档看来,正确的做法是通过 curl 发出 DELETE 请求,如下所述:https://ravendb.net/docs/article-page/3.5/http/client-api/commands/documents/how-to/delete-or-update-documents-using-index,请求如下:
curl -X DELETE "http://localhost:8080/databases/NorthWind/bulk_docs/Raven/DocumentsByEntityName?&query=Tag%3AShops&allowStale=false"
但唯一的例子是删除集合中的所有文档。看起来我应该能够包含像“propertyname=MakeThisGoAway&value=true”这样的查询,但我在文档中找不到任何关于其具体工作原理的内容。我错过了什么吗?
【问题讨论】:
标签: ravendb