coen-hyde/Shanty-Mongo — Issue #43: Document set containing document with DocumentSet
Author: tholder
Created: 2011-10-09 23:48:37+00:00
State: open

This may not be a bug but something is up with it.

If you have a document structured like:

company
--->categories [DocumentSet]
--------->category
---------------->access [DocumentSet]
----------------------->access

You can't do this:

$c = $company->categories->new();
$c->name = 'My Cat'l
$c->save();

$a = $c->access->new();
$a->hasAccess = true;
$a->save();

When calling second save I get:

MongoCursorException: can't append to array using string field name [access] in on line 948

It's not clear the correct order in which to be saving things. I have, accidentally, managed to get it saving correctly once but I've just lost the correct combination. Will add it when I find it.