php-doc-en/reference/mongo/mongominkey.xml
Jakub Vrana 58e026c057 Fix PHP syntax errors
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301119 c90b9560-bf6c-de11-be94-00142212c4b1
2010-07-09 11:28:40 +00:00

91 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.mongominkey" 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 MongoMinKey class</title>
<titleabbrev>MongoMinKey</titleabbrev>
<partintro>
<!-- {{{ MongoBinData intro -->
<section xml:id="mongominkey.intro">
&reftitle.intro;
<para>
<classname>MongoMinKey</classname> is a special type used by the database
that evaluates to less than any other type. Thus, if a query is sorted by a
given field in ascending order, any document with a
<classname>MongoMinKey</classname> as its value will be returned first.
</para>
<para>
<classname>MongoMinKey</classname> has no associated fields, methods, or
constants. It is merely the "smallest" thing that can be inserted into the
database.
</para>
</section>
<!-- }}} -->
<section xml:id="mongominkey.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoMinKey</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoMinKey</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
</classsynopsis>
<!-- }}} -->
</section>
<section xml:id="mongominkey.example">
<title>Using <classname>MongoMinKey</classname> as a value</title>
<programlisting role="php">
<![CDATA[
<?php
$collection->insert(array("task" => "lunch", "do by" => new MongoMinKey));
$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 lunch document, then the staff meeting document.
The lunch document will always be returned first, regardless of what else
is added to the collection (unless other documents are added with
<classname>MongoMinKey</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
-->