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

search for in the

MongoTimestamp> <MongoMinKey
[edit] Last updated: Fri, 07 Jun 2013

view this page in

MongoMaxKey クラス

(PECL mongo >= 1.0.2)

導入

MongoMaxKey はデータベースが使う特別な型で、 他のどんな型よりも大きいと評価されます。したがって、 特定のフィールドの昇順でクエリを並べ替えると、値が MongoMaxKey であるドキュメントが最後となります。

MongoMaxKey にはフィールドやメソッド、定数はありません。 データベースに追加するときに使う、単なる "いちばん大きい" ものです。

クラス概要

MongoMaxKey {
}

MongoMaxKey の使用例

<?php

$collection
->insert(array("task" => "dishes""do by" => new MongoMaxKey));
$collection->insert(array("task" => "staff meeting""do by" => new MongoDate(strtotime("+4 days"))));

$cursor $collection->find()->sort(array("do by" => 1));

?>

このカーソルの中身は、まずstaff meetingドキュメント、次にdishesドキュメントとなります。 dishesドキュメントは、今後コレクションに何が追加されたとしても必ず最後になります ("do by" フィールドが MongoMaxKey である別のドキュメントが追加されない限りは)。



add a note add a note User Contributed Notes MongoMaxKey - [0 notes]
There are no user contributed notes for this page.

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