downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoCursor::getNext> <MongoCursor::explain
[edit] Last updated: Fri, 25 May 2012

view this page in

MongoCursor::fields

(PECL mongo >=1.0.6)

MongoCursor::fieldsクエリのフィールドを設定する

説明

public MongoCursor MongoCursor::fields ( array $f )

フィールドは "fieldname" : bool 形式で指定します。 TRUE はそのフィールドを返すこと、そして FALSE はそのフィールドを返さないことを意味します。 1 および 0 を、それぞれ TRUE および FALSE のかわりに使うこともできます。

"summary" フィールドだけを返すようにするには次のようにします。

<?php

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

?>

"hidden" 以外のすべてのフィールドを返すには次のようにします。

<?php

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

?>

パラメータ

f

返したい (あるいは返したくない) フィールド。

返り値

このカーソルを返します。

エラー / 例外

このカーソルの反復処理が始まっている場合、あるいはスカラー型の引数を渡した場合に MongoCursorException をスローします。



add a note add a note User Contributed Notes MongoCursor::fields
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites