update() public method

Update document.
public update ( string $query, array $options = [] ) : boolean
$query string
$options array
return boolean
示例#1
0
 public function testUpdate()
 {
     $couchdb = new CouchDb($this->_testConfig);
     $this->query->data(array('id' => 12345, 'rev' => '1-1', 'title' => 'One'));
     $result = $couchdb->update($this->query);
     $this->assertTrue($result);
     $expected = '/lithium-test/12345';
     $result = $couchdb->last->request->path;
     $this->assertEqual($expected, $result);
     $expected = array();
     $result = $couchdb->last->request->params;
     $this->assertEqual($expected, $result);
 }