mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
gridfs metadata info
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296675 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e2cd568fb5
commit
51885bf991
1 changed files with 34 additions and 2 deletions
|
@ -34,13 +34,13 @@
|
|||
|
||||
<para>
|
||||
For example, the files document is something like:
|
||||
<programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
array("_id" => 123456789, "filename" => "foo.txt", "chunkSize" => 3, "length" => 12)
|
||||
]]>
|
||||
</programlisting>
|
||||
and the chunks documents look like:
|
||||
<programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
array("files_id" => 123456789, "n" => 0, "data" => new MongoBinData("abc"));
|
||||
array("files_id" => 123456789, "n" => 1, "data" => new MongoBinData("def"));
|
||||
|
@ -52,6 +52,38 @@ array("files_id" => 123456789, "n" => 3, "data" => new MongoBinData("jkl"));
|
|||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Inter-Language Compatibility</title>
|
||||
<para>
|
||||
You should be able to use any files created by MongoGridFS with any other
|
||||
drivers, and visa vera. However, some drivers expect that all metadata
|
||||
associated with a file be in a "metadata" field. If you're going to be
|
||||
using other languages, it's a good idea to wrap info you might want them to
|
||||
see in a "metadata" field. For example, instead of:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$grid->storeFile("somefile.txt", array("date" => new MongoDate()));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
use something like:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$grid->storeFile("somefile.txt", array("metadata" => array("date" => new MongoDate())));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The <classname>MongoGridFS</classname> Family</title>
|
||||
|
||||
|
|
Loading…
Reference in a new issue