Location: PHPKode > projects > MongoDB Object Document Mapper > tests/Doctrine/ODM/MongoDB/Tests/Mapping/xml/Doctrine.ODM.MongoDB.Tests.Mapping.User.dcm.xml
<?xml version="1.0" encoding="UTF-8"?>

<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
                  http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">

    <document name="Doctrine\ODM\MongoDB\Tests\Mapping\User" collection="cms_users">
        <field fieldName="id" id="true" />
        <field fieldName="name" name="username" type="string" />
        <field fieldName="email" type="string" unique="true" drop-dups="true" order="desc" />
        <field fieldName="mysqlProfileId" type="integer" unique="true" drop-dups="true" order="desc" />
        <indexes>
            <index unique="true">
                <key name="username" order="desc" />
                <option name="dropDups" value="true" />
            </index>
        </indexes>
        <reference-one target-document="Address" field="address">
            <cascade>
                <remove />
            </cascade>
        </reference-one>
        <reference-many target-document="Phonenumber" field="phonenumbers">
            <cascade>
                <persist />
            </cascade>
        </reference-many>
        <reference-many target-document="Group" field="groups">
            <cascade>
                <all />
            </cascade>
        </reference-many>
        <lifecycle-callbacks>
            <lifecycle-callback method="doStuffOnPrePersist" type="prePersist" />
            <lifecycle-callback method="doOtherStuffOnPrePersistToo" type="prePersist" />
            <lifecycle-callback method="doStuffOnPostPersist" type="postPersist" />
        </lifecycle-callbacks>
    </document>
</doctrine-mongo-mapping>
Return current item: MongoDB Object Document Mapper