LearnBoost/mongoose — pull request #639 by kenpratt (2011-12-07 07:39:37+00:00)
Title: Fixed partially populating multiple children of sub-documents.

I ran into some issues with populating sub-documents -- namely, if you issue more than one populate request in the query, the settings for the populate requests clobber each other (with the last one taking precedence).

For example:

```
query.populate('kids.user', ["name"]).populate('kids.post', ["title"])
```

Would populate the ```kids.post``` fine but not populate ```name``` on ```kids.user```. (```title``` would be present on ```kids.user``` if ```user``` happened to have that field).

Same for conditions:

```
query.populate('kids.user', ["name"]).populate('kids.post', ["title"], { title: "woot" })
```

Would result in *no* ```kids.user``` fields being populated, since none match the condition on ```kids.post```.

I fixed it by saving the query parameters for each sub-path instead of just storing the first query paramaters found and marking sub-paths as existent.