svn: /phpdoc/en/trunk/reference/mongo/ mongoid.xml
| From: | Jeremy Mikola | Date: | Mon, 21 Jul 2014 20:03:05 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/ mongoid.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-12627@lists.php.net to get a copy of this message | ||
jmikola Mon, 21 Jul 2014 20:03:05 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=334344
Log:
Fix docs for MongoID class property
https://jira.mongodb.org/browse/PHP-1081
Changed paths:
U phpdoc/en/trunk/reference/mongo/mongoid.xml
Modified: phpdoc/en/trunk/reference/mongo/mongoid.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongoid.xml 2014-07-21 13:08:52 UTC (rev 334343)
+++ phpdoc/en/trunk/reference/mongo/mongoid.xml 2014-07-21 20:03:05 UTC (rev 334344)
@@ -15,7 +15,7 @@
A unique identifier created for database objects. If an object is inserted
into the database without an _id field, an _id field will be added to it
with a <classname>MongoId</classname> instance as its value. If the data
- has a naturally occuring unique field (say, a username or timestamp) it is
+ has a naturally occuring unique field (e.g. username or timestamp) it is
fine to use this as the _id field instead, and it will not be replaced with
a <classname>MongoId</classname>.
</para>
@@ -23,12 +23,12 @@
Instances of the <classname>MongoId</classname> class fulfill the role that
autoincrementing does in a relational database: to provide a unique key if
the data does not natually have one. Autoincrementing does not work well
- with a sharded database, as it is impossible to find what the next number
- should be quickly. This class fulfills the constraints of quickly
- generating a value that is unique across shards.
+ with a sharded database, as it is difficult to determine the next number in
+ the sequence. This class fulfills the constraints of quickly generating a
+ value that is unique across shards.
</para>
<para>
- Each MongoId is 12 bytes (making its string form 24 hexidecimal characters).
+ Each MongoId is 12 bytes (making its string form 24 hexadecimal characters).
The first four bytes are a timestamp, the next three are a hash of the
client machine's hostname, the next two are the two least significant bytes
of the process id running the script, and the last three bytes are an
@@ -64,7 +64,7 @@
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
- <varname linkend="mongoid.props.id">id</varname>
+ <varname linkend="mongoid.props.id">$id</varname>
<initializer>&null;</initializer>
</fieldsynopsis>
@@ -79,11 +79,19 @@
<title>Fields</title>
<variablelist>
<varlistentry xml:id="mongoid.props.id">
- <term><varname>id</varname></term>
+ <term><varname>$id</varname></term>
<listitem>
<simpara>
This field contains the string representation of this object.
</simpara>
+ <note>
+ <simpara>
+ The property name begins with a <literal>$</literal> character. It may
+ be accessed using
+ <link linkend="language.types.string.parsing.complex">complex variable
+ parsed syntax</link> (e.g.
<literal>$mongoId->{'$id'}</literal>).
+ </simpara>
+ </note>
</listitem>
</varlistentry>
</variablelist>
@@ -92,7 +100,7 @@
<section>
&reftitle.seealso;
<para>
- MongoDB core docs on <link
xlink:href="&url.mongodb.dochub.objectids;">ids</link>.
+ MongoDB core docs on <link
xlink:href="&url.mongodb.dochub.objectids;">ObjectIds</link>.
</para>
</section>
</partintro>