private DocumentChange deleteDoc ( QueryDocumentSnapshot oldDocument ) { ResourcePath resourcePath = oldDocument . getReference ( ) . getResourcePath ( ) ; int oldIndex = documentSet . indexOf ( resourcePath ) ; documentSet = documentSet . remove ( resourcePath ) ; return new DocumentChange ( oldDocument , Type . REMOVED , oldIndex , - 1 ) ; }
Applies a document delete to the document tree . Returns the corresponding DocumentChange event .