Fix #577 #716

merged 1 commit into from Dec 10, 2012


None yet

3 participants

jails commented Dec 8, 2012

To avoid indexation to be saved in the database, DocumentSet will no more be indexed if its parent is not nullon a ::data() call.

For a full indexation use :


For no indexation at all :

$elem->to('array', array('indexed' => false);

As discussed in #li3 it should be noted that this breaks reaching into arrays with keyed subdocuments via their key.

For example, given the following schema:

    '_id' => 'id',
    'name' => 'string',
    'children' => array('type' => 'object', 'array' => true),
    'children._id' => 'id',
    '' => 'string'

You could reach into the children array with their IDs:


I think this behavior is pretty handy because if you build a schema like this you most likely want to reference the child objects in another model. This makes it easy to fetch or modify the referenced subdocument. With the changes in this commit this is no longer possible.

Maybe we should find a way to preserve this functionality while fixing the issue? Was this even a feature or a positive side-effect of the issue? What do you guys think?

jails commented Dec 9, 2012

Since this PR concern only the ::data() exporting step, you will be able to access childrens using their ids like before:


I'm not sure DocumentSet support the -> notation.


In that case, nervermind. Seems that I misunderstood you yesterday, thanks for the fix. :)

@nateabele nateabele merged commit c9dcdaa into UnionOfRAD:dev Dec 10, 2012

1 check passed

Details default The Travis build passed
@jails jails referenced this pull request Dec 10, 2012

Fix #577 #720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment