index.js
function (db, id, operations, cb) {
			request.patch({
				url: host + 'databases/' + db + '/docs/' + id,
				headers: {
					'Content-Type': 'application/json; charset=utf-8'
				},
				body: JSON.stringify(operations)
			}, function (error, response, resBody) {
				if (!error && response.statusCode === 200) {
					var result = JSON.parse(resBody);
					cb(null, result);
				} else {
					cb(error || new Error(response.statusCode), null);
				}
			});
		}
function (db, id, operations, cb) {
			request.patch({
				url: host + 'databases/' + db + '/docs/' + id,
				headers: {
					'Content-Type': 'application/json; charset=utf-8'
				},
				body: JSON.stringify(operations)
			}, function (error, response, resBody) {
				if (!error && response.statusCode === 200) {
					var result = JSON.parse(resBody);
					cb(null, result);
				} else {
					cb(error || new Error(response.statusCode), null);
				}
			});
		}
function ( db , id , operations , cb ) { request . patch ( { url : host + 'databases/' + db + '/docs/' + id , headers : { 'Content-Type' : 'application/json; charset=utf-8' } , body : JSON . stringify ( operations ) } , function ( error , response , resBody ) { if ( ! error && response . statusCode === 200 ) { var result = JSON . parse ( resBody ) ; cb ( null , result ) ; } else { cb ( error || new Error ( response . statusCode ) , null ) ; } } ) ; }
Applies patch operations to document with given id.
@param {string} db
@param {string} id
@param {Array<Object>} operations
@param {Function} cb
Applies patch operations to document with given id .