I'm trying to use the "unique validator" from the DoctrineMongoDBBundle, but I get this error:
[BadMethodCallException] Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::getAssociationTargetClass($assocName) is not implemented yet.
Am I doing something wrong?
I use Symfony 2.1, and latest bundles/projects versions.
I have more details on this problem:
The validator itself looks fine. We likely just need to implement this method (and others if possible) to support the use case.
I have a small question: does it make sense to have an "unique" constraint on an embedded document?
I think it's possible to define a unique index on an embedded document, which should get picked up when the concrete document (corresponding to a collection) determines its indexes. In that sense, I think it's reasonable for embedded documents to also define unique constraints for those fields.
The real problem is: we can't use the "unique" constraint on a field with an "association" (reference or embed).
Do you think it's easy to implement?
I'm asking the same questions, will this get looked at soon?
Issue looks still relevant early 2016.
Can we have a status please?
@davidloubere: as denoted by label status is "needs test" - please feel free to create a failing unit test and submit is a PR, this will speed up working on the issue
According to my tests from #1363 DocumentRepository::findBy() already accepted embedded documents and was working properly - call for tests is still open