Closed jerzypinkas closed 4 years ago
This must be a copy & paste error when importing the FOS code.
Can you provide a PR that removes all unnecessary fields(e.g. safe) here: https://github.com/nucleos/NucleosUserBundle/blob/master/src/Resources/config/doctrine-mapping/User.mongodb.xml https://github.com/nucleos/NucleosUserBundle/blob/master/src/Resources/config/doctrine-mapping/Group.mongodb.xml
vendor/nucleos/user-bundle/src/Resources/config/doctrine-mapping/User.mongodb.xml
After comment out lines 20, 25, 30 (where is <option name="safe" value="true"/>
) everything is OK, a message is: 'Updated indexes for all classes'
similar 'safe option' exists in file vendor/nucleos/user-bundle/src/Resources/config/doctrine-mapping/Group.mongodb.xml but I didn't test it
Also, I've found those issues: https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2963
Can you drop the safe
option for mongo < 4?
What do you mean? I don't want to install another version of mongo.
Sorry for the late response.
Can you create a PR which removes these lines @jerzypinkas ? https://github.com/nucleos/NucleosUserBundle/blob/master/src/Resources/config/doctrine-mapping/User.mongodb.xml#L20 https://github.com/nucleos/NucleosUserBundle/blob/master/src/Resources/config/doctrine-mapping/User.mongodb.xml#L25 https://github.com/nucleos/NucleosUserBundle/blob/master/src/Resources/config/doctrine-mapping/User.mongodb.xml#L30 ... Same for the Group mapping
Can you checkout the latest dev-main
version @jerzypinkas ?
With MongoDB ODM and default Installation from documentation on 'Step 7':
php bin/console doctrine:mongodb:schema:create --index
make response
The field 'safe' is not valid for an index specification. Specification: { key: { usernameCanonical: 1 }, safe: true, unique: true, background: false, ns: "DATABASE.User", name: "usernameCanonical_1" }