Closed haje007 closed 11 years ago
Please point me the documentation file where you saw this. By looking on https://github.com/dready92/PHP-on-Couch/blob/master/doc/couch_client-document.md I read:
"To retrieve several documents in one go, knowing their IDs, select documents using the keys($ids) coupled with the method getAllDocs(). $ids is an array of documents IDs."
Hi, IMHO correct call is: $view = $client->include_docs(true)->keys($myStringKeysArray)->getAllDocs();
shr3k: that's right. Thanks :-)
Documentation says:
To retrieve several documents in one go, knowing their IDs, use the method getAllDocs($ids). $ids is an array of documents IDs. This function acts like a view, so the output is the view output of CouchDB, and you should use "include_docs(TRUE)" to have documents contents.
Example :
$view = $client->include_docs(true)->getAllDocs( array('BlogPost5676','BlogComments5676') ); foreach ( $view->rows as $row ) { echo "doc id :".$row->doc->_id."\n"; }
Core doesn't have an argument.. :
public function getAllDocs ( ) { $url = '/'.urlencode($this->dbname).'/_all_docs'; list($method, $view_query, $data) = $this->_prepare_view_query(); return $this->_queryAndTest ($method, $url, array(200),$view_query,$data); }