We're using doctrine/mongodb-odm in our project and there is a model with references to another model:
@ReferenceMany(targetDocument="Extra", simple=true)
When we retrieve the referenced objects it's possible that one of the objects isn't available anymore. So we have added the sort attribute to ensure that a db query will be executed (deleted objects are ignored):
@ReferenceMany(targetDocument="Extra", simple=true, sort={"name"="asc"})
With doctrine/mongodb-odm 1.0.3 it isn't possible anymore and breaks with Doctrine\ODM\MongoDB\Mapping\MappingException:
ReferenceMany's sort can not be used with addToSet and pushAll strategies, pushAll used in Example::extras
Why I can't use "sort" with these strategies? Are strategies not only interesting for write requests?
Is it possible to use the set strategy to keep the same application logic?
@ReferenceMany(targetDocument="Extra", simple=true, strategy="set", sort={"name"="asc"})
Is the only difference, when I add a further reference, all existing references will completely rewritten?