[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ ensureindex.xml
From:       Kristina_Chodorow <kristina () php ! net>
Date:       2009-10-29 22:45:05
Message-ID: svn-kristina-1256856305-290067-431464624 () svn ! php ! net
[Download RAW message or body]

kristina                                 Thu, 29 Oct 2009 22:45:05 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=290067

Log:
unique index

Changed paths:
    U   phpdoc/en/trunk/reference/mongo/mongocollection/ensureindex.xml

Modified: phpdoc/en/trunk/reference/mongo/mongocollection/ensureindex.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongocollection/ensureindex.xml	2009-10-29 \
                22:31:35 UTC (rev 290066)
+++ phpdoc/en/trunk/reference/mongo/mongocollection/ensureindex.xml	2009-10-29 \
22:45:05 UTC (rev 290067) @@ -15,7 +15,11 @@
   <methodsynopsis>
    <modifier>public</modifier> \
<type>boolean</type><methodname>MongoCollection::ensureIndex</methodname>  \
<methodparam><type>string|array</type><parameter>keys</parameter></methodparam> +   \
<methodparam><type>boolean</type><parameter>unique</parameter></methodparam>  \
</methodsynopsis> +  <para>
+   A unique index cannot be created on a field if multiple existing documents do not \
contain the field.  The field is effectively &null; for these documents and thus \
already non-unique. +  </para>
  </refsect1>

  <refsect1 role="parameters">
@@ -32,6 +36,16 @@
       </para>
      </listitem>
     </varlistentry>
+    <varlistentry>
+     <term>
+      <parameter>unique</parameter>
+     </term>
+     <listitem>
+      <para>
+       If the index should be unique.
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
   </para>
  </refsect1>
@@ -65,6 +79,9 @@
 // create an index on 'z' ascending and 'zz' descending
 $c->ensureIndex(array('z' => 1, 'zz' => -1));

+// create a unique index on 'x'
+$c->ensureIndex(array('x' => 1), true);
+
 ?>
 ]]>
    </programlisting>



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic