public function lookupByKeys($collectionId, array $keys, array $options = [])
    {
        $_documentClass = $this->_documentClass;

        $body = [
            self::OPTION_COLLECTION => $collectionId,
            self::OPTION_KEYS       => $keys
        ];

        $response = $this->getConnection()->put(Urls::URL_LOOKUP_BY_KEYS, $this->json_encode_wrapper($body));

        $responseArray = $response->getJson();

        $result = [];
        foreach ($responseArray['documents'] as $document) {
            $result[] = $_documentClass::createFromArray($document, $options);
        }

        return $result;
    }
public function lookupByKeys($collectionId, array $keys, array $options = [])
    {
        $_documentClass = $this->_documentClass;

        $body = [
            self::OPTION_COLLECTION => $collectionId,
            self::OPTION_KEYS       => $keys
        ];

        $response = $this->getConnection()->put(Urls::URL_LOOKUP_BY_KEYS, $this->json_encode_wrapper($body));

        $responseArray = $response->getJson();

        $result = [];
        foreach ($responseArray['documents'] as $document) {
            $result[] = $_documentClass::createFromArray($document, $options);
        }

        return $result;
    }
public function lookupByKeys ( $ collectionId , array $ keys , array $ options = [ ] ) { $ _documentClass = $ this -> _documentClass ; $ body = [ self :: OPTION_COLLECTION => $ collectionId , self :: OPTION_KEYS => $ keys ] ; $ response = $ this -> getConnection ( ) -> put ( Urls :: URL_LOOKUP_BY_KEYS , $ this -> json_encode_wrapper ( $ body ) ) ; $ responseArray = $ response -> getJson ( ) ; $ result = [ ] ; foreach ( $ responseArray [ 'documents' ] as $ document ) { $ result [ ] = $ _documentClass :: createFromArray ( $ document , $ options ) ; } return $ result ; }
Bulk lookup documents by specifying an array of keys

This will throw on any error

@throws Exception

@param mixed $collectionId        - collection id as string or number
@param array $keys                - array of document keys
@param array $options             - optional array of options.
<p>Options are :<br>
<li>'_sanitize'         - True to remove _id and _rev attributes from result documents. Defaults to false.</li>
<li>'_hiddenAttributes' - Set an array of hidden attributes for created documents.
</p>

@return array - an array containing all documents found for the keys specified.
note that if for a given key not document is found, it will not be returned nor will the document's non-existence be reported.

@since 2.6
Bulk lookup documents by specifying an array of keys