<?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="Bundle\FOS\UserBundle\Document\Group" collection="fos_user_group">

        <field name="name" fieldName="name" type="string" />

        <field name="roles" fieldName="roles" type="hash" />

        <indexes>
            <index unique="true" dropDups="true">
                <key name="name" order="asc" />
                <option name="safe" value="true" />
            </index>
        </indexes>

    </document>

</doctrine-mongo-mapping>

<?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="Bundle\FOS\UserBundle\Document\Group" collection="fos_user_group">

        <field name="id" fieldName="id" id="true" />

        <field name="name" fieldName="name" type="string" />

        <field name="roles" fieldName="roles" type="hash" />

        <indexes>
            <index unique="true" dropDups="true">
                <key name="name" order="asc" />
                <option name="safe" value="true" />
            </index>
        </indexes>

    </document>

</doctrine-mongo-mapping>

Add back ODM mapping for Group class' ID property
Add back ODM mapping for Group class' ID property

See: c8ba7b6396fffad4ed755d650c06518693577c4c
