[MODM-173] Change the name of the collection dynamic Created: 27/Jun/13 Updated: 27/Jun/13
|Project:||Doctrine MongoDB ODM|
|Reporter:||Daniel Gafitescu||Assignee:||Jonathan H. Wage|
I have to create collection for users per each day they register so if I have 5 users and 2 register on 2013-03-02 and 3 have register on 2013-03-03 I will have 2 collections
The user is declare in a YML file with no collection specified
In the project I do an import via CLI something like this
Problem is that when I look in the mongoDB I see only one collection with name "day_2013-03-03" which is the last date , if I set the
after the foreach end statement which I should it save all in the first collection "03-02".
|Comment by Marco Pivetta [ 27/Jun/13 ]|
I personally don't think that's an use case to be handled in the ODM.
The problem is that class metadata properties are not constantly accessed, but instead cached locally in various components for performance reasons.
A fix for this would be to explicitly deny modification of metadata after it was returned by the metadata factory (after "onLoadMetadata" events).
|Comment by Daniel Gafitescu [ 27/Jun/13 ]|
Reinitialize the DoctrineManager at every group of document did the trick but it's just not beautiful code.