mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301119 c90b9560-bf6c-de11-be94-00142212c4b1
91 lines
2.5 KiB
XML
91 lines
2.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<phpdoc:classref xml:id="class.mongomaxkey" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<title>The MongoMaxKey class</title>
|
|
<titleabbrev>MongoMaxKey</titleabbrev>
|
|
|
|
<partintro>
|
|
|
|
<!-- {{{ MongoBinData intro -->
|
|
<section xml:id="mongomaxkey.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
<classname>MongoMaxKey</classname> is a special type used by the database
|
|
that evaluates to greater than any other type. Thus, if a query is sorted
|
|
by a given field in ascending order, any document with a
|
|
<classname>MongoMaxKey</classname> as its value will be returned last.
|
|
</para>
|
|
<para>
|
|
<classname>MongoMaxKey</classname> has no associated fields, methods, or
|
|
constants. It is merely the "largest" thing that can be inserted into the
|
|
database.
|
|
</para>
|
|
</section>
|
|
<!-- }}} -->
|
|
|
|
<section xml:id="mongomaxkey.synopsis">
|
|
&reftitle.classsynopsis;
|
|
|
|
<!-- {{{ Synopsis -->
|
|
<classsynopsis>
|
|
<ooclass><classname>MongoMaxKey</classname></ooclass>
|
|
|
|
<!-- {{{ Class synopsis -->
|
|
<classsynopsisinfo>
|
|
<ooclass>
|
|
<classname>MongoMaxKey</classname>
|
|
</ooclass>
|
|
</classsynopsisinfo>
|
|
<!-- }}} -->
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
|
|
</section>
|
|
|
|
<section xml:id="mongomaxkey.example">
|
|
<title>Using <classname>MongoMaxKey</classname> as a value</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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));
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
The cursor will contain the staff meeting document, then the dishes
|
|
document. The dishes document will always be returned last, regardless of
|
|
what else is added to the collection (unless other documents are added with
|
|
<classname>MongoMaxKey</classname> in the "do by" field).
|
|
</para>
|
|
</section>
|
|
</partintro>
|
|
|
|
</phpdoc:classref>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|