Exemple #1
0
 private function fetchDocuments()
 {
     $this->fetching = true;
     $response = $this->protocol->opQuery($this->fcn, $this->getQuery(), $this->querySkip, $this->calculateRequestLimit(), 0, $this->queryTimeout, $this->fields);
     $this->cursorId = $response['cursorId'];
     $this->setDocuments($response);
 }
Exemple #2
0
 /**
  * Execute a database command
  *
  * @param array $command - The query to send.
  * @param array $options - This parameter is an associative array of
  *   the form array("optionname" => boolean, ...).
  *
  * @return array - Returns database response.
  */
 public function command(array $cmd, array $options = [])
 {
     $timeout = MongoCursor::$timeout;
     if (!empty($options['timeout'])) {
         $timeout = $options['timeout'];
     }
     $response = $this->protocol->opQuery("{$this->name}.\$cmd", $cmd, 0, -1, 0, $timeout);
     return $response['result'][0];
 }