index.js
function (id, data, options, callback) {
            var args = arguments,
                r,
                handler,
                retry = false,
                requestOptions = {
                    method: 'PUT',
                    headers: {
                        'content-type': 'application/json'
                    }
                };

            if (typeof options === 'function') {
                callback = options;
            } else {
                options = extend({}, options);
                retry = options.retry;
            }

            retry = (retry === true) && function () {
                this.update.apply(this, args);
            }.bind(this);

            handler = createResponseHandler(callback, retry);

            r = req(client.documentsURL + '/' + id, requestOptions, handler);
            data = new Buffer(JSON.stringify(data));
            r.setHeader('content-length', data.length);
            r.end(data);
            return r;
        }
function (id, data, options, callback) {
            var args = arguments,
                r,
                handler,
                retry = false,
                requestOptions = {
                    method: 'PUT',
                    headers: {
                        'content-type': 'application/json'
                    }
                };

            if (typeof options === 'function') {
                callback = options;
            } else {
                options = extend({}, options);
                retry = options.retry;
            }

            retry = (retry === true) && function () {
                this.update.apply(this, args);
            }.bind(this);

            handler = createResponseHandler(callback, retry);

            r = req(client.documentsURL + '/' + id, requestOptions, handler);
            data = new Buffer(JSON.stringify(data));
            r.setHeader('content-length', data.length);
            r.end(data);
            return r;
        }
function ( id , data , options , callback ) { var args = arguments , r , handler , retry = false , requestOptions = { method : 'PUT' , headers : { 'content-type' : 'application/json' } } ; if ( typeof options === 'function' ) { callback = options ; } else { options = extend ( { } , options ) ; retry = options . retry ; } retry = ( retry === true ) && function ( ) { this . update . apply ( this , args ) ; } . bind ( this ) ; handler = createResponseHandler ( callback , retry ) ; r = req ( client . documentsURL + '/' + id , requestOptions , handler ) ; data = new Buffer ( JSON . stringify ( data ) ) ; r . setHeader ( 'content-length' , data . length ) ; r . end ( data ) ; return r ; }
Update the metadata for a single document
@param   {String}   id               The document uuid
@param   {Object}   data             The new metadata
@param   {Object}   [options]        Update options
@param   {boolean}  [options.retry]  Whether to retry the request after 'retry-after' seconds if the retry-after header is sent
@param   {Function} [callback]       A callback to call with the response data (or error)
@returns {Request}
Update the metadata for a single document