tblobaum/mongoose-troop — Issue #12: merge doesn't work on deep paths
Author: msaffitz
Created: 2012-01-24 06:10:54+00:00
State: open

First, thanks for the really useful library.

The merge utility doesn't appear to work on deeply nested paths. For example, if I have a schema:

```
name:
first: String
last: String
```

then the first and last properties aren't merged into the parent object. It looks like this is because the value is retrieved on the source document by array getter (e.g. doc[name]), and when name is "name.first" the retrieval fails.

(I think this is relatively straightforward to fix, but I also believe you need to code for edge cases around circular references, which if is the case complicates things some. it's possible the code from node.extend could be leveraged?...)