mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Documentation fixes and changes for 1.3.0.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321505 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
2017c6f1e5
commit
e1dd919618
5 changed files with 82 additions and 14 deletions
|
@ -14,13 +14,13 @@
|
|||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>MongoCollection::ensureIndex</methodname>
|
||||
<methodparam><type>array</type><parameter>keys</parameter></methodparam>
|
||||
<methodparam><type>string|array</type><parameter>key|keys</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>array()</initializer></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.
|
||||
This method creates an index on the collection and the specified fields.
|
||||
The key specification can either be just a single field name as string, or an
|
||||
array containing one or more field names with their sort direction.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -55,6 +55,13 @@
|
|||
<para>
|
||||
Create a unique index.
|
||||
</para>
|
||||
<warning>
|
||||
<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>
|
||||
</warning>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
|
@ -103,9 +110,9 @@
|
|||
<literal>"name"</literal>
|
||||
</para>
|
||||
<para>
|
||||
After driver version 1.0.4 (NOT including 1.0.4) you can specify an
|
||||
index name. This can be useful if you are indexing many keys and
|
||||
Mongo complains about the index name being too long.
|
||||
Starting with driver version 1.0.5 you can specify an index name.
|
||||
This can be useful if you are indexing many keys and Mongo complains
|
||||
about the index name being too long.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
@ -148,9 +155,11 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>1.0.2</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
Changed "options" parameter from boolean to array. Pre-1.0.2, the
|
||||
second parameter was an optional boolean value specifying a unique
|
||||
index.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
|
@ -167,11 +176,17 @@
|
|||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.0.2</entry>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Changed "options" parameter from boolean to array. Pre-1.0.2, the
|
||||
second parameter was an optional boolean value specifying a unique
|
||||
index.
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.3.0</entry>
|
||||
<entry>
|
||||
The <parameter>options</parameter> parameter does no longer accept
|
||||
just a boolean to signify a unique index. Instead, this now has to be done
|
||||
with <literal>array('unique' => true)</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
@ -209,7 +224,10 @@
|
|||
$c = new MongoCollection($db, 'foo');
|
||||
|
||||
// create an index on 'x' ascending
|
||||
$c->ensureIndex(array('x' => 1));
|
||||
$c->ensureIndex('x');
|
||||
|
||||
// create an index on 'y' ascending
|
||||
$c->ensureIndex(array('y' => 1));
|
||||
|
||||
// create an index on 'z' ascending and 'zz' descending
|
||||
$c->ensureIndex(array('z' => 1, 'zz' => -1));
|
||||
|
|
|
@ -291,6 +291,14 @@
|
|||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.3.0</entry>
|
||||
<entry>
|
||||
The <parameter>options</parameter> parameter does no longer accept
|
||||
just a boolean to signify a safe insert. Instead, this now has to be done
|
||||
with <literal>array('safe' => true)</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -178,6 +178,14 @@
|
|||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.3.0</entry>
|
||||
<entry>
|
||||
The <parameter>options</parameter> parameter does no longer accept
|
||||
just a boolean to signify "justOne". Instead, this now has to be done
|
||||
with <literal>array('justOne' => true)</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -211,6 +211,14 @@
|
|||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.3.0</entry>
|
||||
<entry>
|
||||
The <parameter>options</parameter> parameter does no longer accept
|
||||
just a boolean to signify an upsert. Instead, this now has to be done
|
||||
with <literal>array('upsert' => true)</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -47,6 +47,32 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1.3.0</entry>
|
||||
<entry>
|
||||
The <parameter>options</parameter> parameter does no longer accept
|
||||
just a boolean to signify a safe insert. Instead, this now has to be done
|
||||
with <literal>array('safe' => true)</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
|
|
Loading…
Reference in a new issue