If what you want is to delete everything, then you can do this:
public class AllDocumentsById : AbstractIndexCreationTask
{
public override IndexDefinition CreateIndexDefinition()
{
return
new IndexDefinition
{
Name = "AllDocumentsById",
Map = "from doc in docs
let DocId = doc[\"@metadata\"][\"@id\"]
select new {DocId};"
};
}
}
docStore.DatabaseCommands.DeleteByIndex("AllDocumentsById", new IndexQuery());
If you have a different index that you want to delete based on then that should work as well. We are using this pattern for some tests as well.