public boolean update ( final V value , final long maxTime , final TimeUnit timeUnit ) { final K key = keyOf ( value ) ; if ( key != null ) { return collectionWithWriteTimeout ( maxTime , timeUnit ) . replaceOne ( byId ( key ) , encode ( value ) ) . getModifiedCount ( ) == 1 ; } else { throw new IllegalArgumentException ( "Key must not be null" ) ; } }
Updates the document if it is already present in the repository .