DocumentSet remove(ResourcePath key) {
    QueryDocumentSnapshot document = keyIndex.get(key);
    if (document == null) {
      return this;
    }

    ImmutableSortedMap<ResourcePath, QueryDocumentSnapshot> newKeyIndex = keyIndex.remove(key);
    ImmutableSortedSet<QueryDocumentSnapshot> newSortedSet = sortedSet.remove(document);
    return new DocumentSet(newKeyIndex, newSortedSet);
  }
DocumentSet remove ( ResourcePath key ) { QueryDocumentSnapshot document = keyIndex . get ( key ) ; if ( document == null ) { return this ; } ImmutableSortedMap < ResourcePath , QueryDocumentSnapshot > newKeyIndex = keyIndex . remove ( key ) ; ImmutableSortedSet < QueryDocumentSnapshot > newSortedSet = sortedSet . remove ( document ) ; return new DocumentSet ( newKeyIndex , newSortedSet ) ; }
Returns a new DocumentSet with the document for the provided key removed.