I searched for a similar question, but I couldn't find any topic discussing it.
Now that
Raven/DocumentsByEntityName is gone, how can one delete a collection of documents? We've been using the following code to accomplish it:
private Operation InternalDropCollection<TDocument>()
{
var tag = _store.Conventions.GetTypeTagName(typeof(TDocument));
var operation = _store.DatabaseCommands.DeleteByIndex("Raven/DocumentsByEntityName", new IndexQuery { Query = "Tag:" + tag }, true);
return operation;
}
I've tried to use the most obvious code I could think of, on top of the sample data generated in the RavenStudio:
var indexQuery = new IndexQuery { Query = "Tag:categories" };
var operation = documentStore.Operations.Send(new DeleteByQueryOperation(indexQuery));
return operation;
However, it throws back the following exception:
Raven.Client.Exceptions.RavenException: Raven.Server.Documents.Queries.Parser.QueryParser+ParseException: 1:1 Expected FROM clause but got: Tag:categories
Query:
Tag:categories
Thanks in advance.