0
使用PHP-ON-COUCH,我嘗試使用php-on-couch獲取couchdb中的所有記錄,但它不能快速運行。php-on-couch快速獲取所有記錄
require_once "lib/couch.php";
require_once "lib/couchClient.php";
require_once "lib/couchDocument.php";
$couch_dsn = "http://localhost:5984/";
$couch_db = "couch";
$client = new couchClient($couch_dsn,$couch_db);
$all_singers = $client->getAllDocs();
foreach ($all_singers->rows as $row) {
$doc = $client->getDoc($id);
echo $doc->singer;
echo $doc->title;
echo $doc->description;
}
是否有另一種方法正確地做到這一點?
預先感謝您
感謝亞歷克西斯,它的作品很好!你只需在類couchClient的方法getAllDocs中添加參數「include_docs」 –
我改變了它,如果它幫助你,請接受答案! :) –