The DeleteByQueryAsync is used to delete files that match the specified query.
Task DeleteByQueryAsync(string query);
The Lucene query
A task that represents the asynchronous delete operation.
In order to delete files located in /temp folder except from ones in its subdirectories, run the following code:
await store.AsyncFilesCommands.DeleteByQueryAsync("__directoryName:/temp AND __level:2");
Delete on the server side
To delete a file, RavenFS needs to remove a lot of information related to this file. In order to respond to the user quickly, the file is just renamed and a delete marker is added to its metadata. The actual delete is performed by a periodic task, which ensures that all the requested deletes will be accomplished even in the presence of a server restarts in the middle.