chill/chill

CouchDb 客户端库,适用于 PHP 5.3+

v1.0.0 2013-02-26 11:51 UTC

This package is auto-updated.

Last update: 2024-09-22 02:18:47 UTC


README

Chill 是一个简单高效的 CouchDb 客户端库,适用于 PHP。在 BSD 2 Clause 许可证下发布,并通过 Composer/Packagist 提供使用。

当前构建状态

Build Status

示例用法

通过 ID 获取单个文档

$chill = new Chill\Client('localhost', 'my_database');
$doc = $chill->get('8128173972d50affdb6724ecbd00d9fc');
print $doc['_id'];

以 Chill 文档对象的形式获取视图的查询结果

$chill = new Chill\Client('localhost', 'my_database');
$docs = $chill->asDocuments()->getView('mydesign', 'myview', array('key1', 'key2'));

foreach ($docs as $doc) {
    print $doc->_id . PHP_EOL;
} 

获取和更新文档

$chill = new Chill\Client('localhost', 'my_database');
$doc = $chill->get('8128173972d50affdb6724ecbd00d9fc');
$doc->title = 'Changing my doc.';
$doc->save();

感谢