MontoTalk does not handle it. 
Voyage does :)

but... an "embedded collection" sounds strange to me... I don't really think 
that is correct. There is no such thing like embedded collection in a mongodb 
sense (If I'm understanding right you question). 
Let's say you have for example this: 

ObjectA(ObjectB, CollectionOfObjectC)

If ObjectA is marked as Root, you will save a document with ObjectB and a 
collection of ObjectC embedded into it (but is not an embedded collection, is 
just a document who has embedded objects, no matter if that object happens to 
be an array or any kind of smalltalk collection).
but, for example, if ObjectC is marked as a Root too, Voyage will save ObjectA 
as a document with a list of references to ObjectC. 
Then your database will have two collections: ObjectAs and ObjectCs
Other thing is that Voyage is just a mapper, not a complete DB implementation, 
so, if you remove ObjectA (for instance), and there are not more references to 
ObjectC, you need to remove it from database manually, nor mongo, nor 
mongotalk, not voyage will handle that kind of situations for you :)

Esteban 


On Nov 26, 2012, at 5:53 PM, Yanni Chiu <[email protected]> wrote:

> On 25/11/12 5:04 AM, Fernando Olivero wrote:
>> Hi, this seems to answer your question.
>> 
>> http://articles.tulipemoutarde.be/embedded-document-with-voyage-in-mongodb
> 
> The model in that article has a one-to-many relation between a Spaceship and 
> Pilots. The Pilot isPersistent/isRoot, so has its own MongoDB collection. 
> IIUC, if Pilot were not persistent/root, then the collection of pilots would 
> be serialized along with the Spaceship object, and there would be no separate 
> Pilot collection in MongeDB.
> 
> So my question is, how does MongoTalk handle the editing of the pilot 
> collection, when it's embedded into the Spaceship. For example, if a pilot is 
> added, removed, or updated, does the entire embedded collection get re-saved, 
> or does a suitable MongoDB update query get generated?
> 
> 
> 


Reply via email to