PHP Doku:: Sets the fields for a query - mongocursor.fields.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenMongoDB Native DriverCore ClassesThe MongoCursor classMongoCursor::fields

Ein Service von Reinhard Neidl - Webprogrammierung.

The MongoCursor class

<<MongoCursor::explain

MongoCursor::getNext>>

MongoCursor::fields

(PECL mongo >=1.0.6)

MongoCursor::fieldsSets the fields for a query

Beschreibung

public MongoCursor MongoCursor::fields ( array $f )

Fields are specified by "fieldname" : bool. TRUE indicates that a field should be returned, FALSE indicates that it should not be returned. You can also use 1 and 0 instead of TRUE and FALSE.

Thus, to return only the "summary" field, one could say:

<?php

$cursor
->fields(array("summary" => true));

?>

To return all fields except the "hidden" field:

<?php

$cursor
->fields(array("hidden" => false));

?>

Parameter-Liste

f

Fields to return (or not return).

Rückgabewerte

Returns this cursor.

Fehler/Exceptions

Throws MongoCursorException if this cursor has started iterating or a scalar argument is given.


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)