code: public UpdateIfMatchResult updateIfMatch(final V value,
                                               final String eTag,
                                               final long maxTime,
                                               final TimeUnit timeUnit) {
          final K key = keyOf(value);
          if (key != null) {
              final Bson query = and(eq(AbstractMongoRepository.ID, key), eq(ETAG, eTag));
  
              final Document updatedETaggable = collectionWithWriteTimeout(maxTime, timeUnit).findOneAndReplace(query, encode(value), new FindOneAndReplaceOptions().returnDocument(AFTER));
              if (isNull(updatedETaggable)) {
                  final boolean documentExists = collection()
                          .countDocuments(eq(AbstractMongoRepository.ID, key), new CountOptions().maxTime(maxTime, timeUnit)) != 0;
                  if (documentExists) {
                      return CONCURRENTLY_MODIFIED;
                  }
  
                  return NOT_FOUND;
              }
  
              return OK;
          } else {
              throw new IllegalArgumentException("Key must not be null");
          }
      }
docs: Updates the document if the document's ETAG is matching the given etag (conditional put).
  <p>
  Using this method requires that the document contains an "etag" field that is updated if
  the document is changed.
  </p>
  
  @param value    the new value
  @param eTag     the etag used for conditional update
  @param maxTime  max time for the update
  @param timeUnit the time unit for the maxTime value
  @return {@link UpdateIfMatchResult}