async notifyDocumentReplace(request, document, cache = null) {
    const rooms = this._test(request, document._source, document._id);

    if (rooms.length > 0) {
      await this.notifyDocument(rooms, request, "in", "replace", document);
    }

    if (cache !== null) {
      const stopListening = difference(JSON.parse(cache), rooms);

      await this.notifyDocument(
        stopListening,
        request,
        "out",
        "replace",
        document,
      );
    }

    return rooms;
  }
Notify about a replaced document

@param {Request} request
@param {DocumentChanges} document
@param {string} cache notification content for that document
@returns {Promise.<Array.<string>} list of matched rooms