From f2d59658fa5b59cd96d3379a03814c274bab15b1 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 27 Jun 2018 16:12:43 +0000 Subject: [PATCH] Add very basic information on fieldPath mappings. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345223 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongodb/architecture.xml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/reference/mongodb/architecture.xml b/reference/mongodb/architecture.xml index 44d79a2604..1d5766ffa8 100644 --- a/reference/mongodb/architecture.xml +++ b/reference/mongodb/architecture.xml @@ -557,8 +557,18 @@ class UpperClass implements MongoDB\BSON\Persistable { - Each of those three data types can be mapped against different PHP types. - The possible mapping values are: + Besides the three collective types, it is also possible to configure + specific fields in your document to map to the data types mentioned below. + As an example, this fieldPath feature allows you to + map each "city" element of a field that stores + addresses to the City class by setting: + ['addresses.$.city' => 'MyProject\City'] in the typemap. + + + + Each of those three data types, as well as the field specific mappings, + can be mapped against different PHP types. The possible mapping values + are: @@ -691,8 +701,9 @@ class UpperClass implements MongoDB\BSON\Persistable { MongoDB\Driver\Cursor object, or the $typeMap argument of MongoDB\BSON\toPHP. Each of the three - classes (root, document and - array) can be individually set. + classes (root, document, and + array) can be individually set, in addition to the + field specific types.