LearnBoost/mongoose — pull request #563 by vedmalex (2011-10-12 14:18:32+00:00)
Title: fix to populate engine

fixed: use clone of populate[path] because it is changed in execution context and then became unusable --> so it drives to query returns different objects from what i've expected.
explanation:
in _populate method there is condition
options.conditions || (options.conditions = {});
options.conditions._id || (options.conditions._id = { $in: oid });
and when query returns more that one document that must be populated, then the condition on query itself became changed. so next query will never populate anything for the same path.