public function replaceById($collection, $documentId, Document $document, array $options = [])
    {
        return $this->put(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options);
    }
public function replaceById($collection, $documentId, Document $document, array $options = [])
    {
        return $this->put(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options);
    }
public function replaceById ( $ collection , $ documentId , Document $ document , array $ options = [ ] ) { return $ this -> put ( Urls :: URL_DOCUMENT , $ collection , $ documentId , $ document , $ options ) ; }
Replace an existing document in a collection, identified by collection id and document id

This will update the document on the server

This will throw if the document cannot be Replaced

If policy is set to error (locally or globally through the ConnectionOptions)
and the passed document has a _rev value set, the database will check
that the revision of the to-be-replaced document is the same as the one given.

@throws Exception

@param mixed    $collection   - collection id as string or number
@param mixed    $documentId   - document id as string or number
@param Document $document     - document to be updated
@param array    $options      - optional, array of options
<p>Options are :
<li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li>
<li>'waitForSync' - can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li>
</p>

@return bool - always true, will throw if there is an error
Replace an existing document in a collection identified by collection id and document id