From 51885bf991039890562616999b96791257d54138 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Tue, 23 Mar 2010 14:28:02 +0000 Subject: [PATCH] gridfs metadata info git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296675 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/mongogridfs.xml | 36 +++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/reference/mongo/mongogridfs.xml b/reference/mongo/mongogridfs.xml index 6ea9e87c65..a27bdeae0a 100644 --- a/reference/mongo/mongogridfs.xml +++ b/reference/mongo/mongogridfs.xml @@ -34,13 +34,13 @@ For example, the files document is something like: - + 123456789, "filename" => "foo.txt", "chunkSize" => 3, "length" => 12) ]]> and the chunks documents look like: - + 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")); +
+ Inter-Language Compatibility + + 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: + + +storeFile("somefile.txt", array("date" => new MongoDate())); + +?> +]]> + + + use something like: + + +storeFile("somefile.txt", array("metadata" => array("date" => new MongoDate()))); + +?> +]]> + +
+
The <classname>MongoGridFS</classname> Family