fields() public method

Sets the fields for a query
public fields ( array $f ) : MongoCursor
$f array Fields to return (or not return).
return MongoCursor
Exemplo n.º 1
0
 /**
  * Wrapper method for MongoCursor::fields().
  *
  * @param array $f Fields to return (or not return).
  *
  * @see http://php.net/manual/en/mongocursor.fields.php
  * @return self
  */
 public function fields(array $f)
 {
     $this->fields = $f;
     $this->mongoCursor->fields($f);
     return $this;
 }
Exemplo n.º 2
0
 public function fields($f)
 {
     parent::fields($f);
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Sets the fields for a query. Query will return arrays instead of Documents if selection
  * fields are set.
  *
  * @link http://www.php.net/manual/en/mongocursor.fields.php
  * @param array $fields Fields to return (or not return).
  * @throws \MongoCursorException
  * @return $this
  */
 public function fields(array $fields)
 {
     $this->cursor->fields($fields);
     $this->class = null;
     return $this;
 }
Exemplo n.º 4
0
 /**
  * 设置需要返回或不需要返回的字段
  * @param Array $f = array('mnick'=>0不返回1返回)
  * @return muMongoCursor
  */
 public function fields($f)
 {
     $this->oMongoCursor->fields($f);
     return $this;
 }