Object that allows waiting for an operation to complete.
DeleteByIndex can only be performed on a map index. Executing it on map-reduce index will lead to an exception.
The document will be removed from the server after the method is called and not after SaveChanges.
// remove all documents from the server where Name == Bob using Person/ByName index
var operation1 = session.Advanced.DeleteByIndex<Person>("Person/ByName", x => x.Name == "Bob");
//remove all documents from the server where Age > 35 using Person/ByAge index
var operation2 = session.Advanced.DeleteByIndex<Person, Person_ByAge>(x => x.Age < 35);