Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added suffix support to populate() #991

Closed
wants to merge 2 commits into from
Closed

Commits on Jun 30, 2012

  1. Added suffix support to populate().

    Call populate(path, fields, conditions, options) with options.suffix
    defined, and the populated object will go into a new field, key+suffix,
    instead of overwriting the id field.
    
    For example, for compatibility with ExtJS4, we might want to send down
    an object in this manner to be friendly to ExtJS' association support:
    
    User{
       comment: "4f5cd5f6e9786ec113000006"
       comment_obj: {text: "foo"}
    }
    
    Calling User.findOne().populate('comment', null, null, {suffix:
    '_obj'}) will add this suffix.
    Samuel Reed committed Jun 30, 2012
    Configuration menu
    Copy the full SHA
    e0fe98a View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2012

  1. Started working on a test for suffixes.

    Samuel Reed committed Jul 9, 2012
    Configuration menu
    Copy the full SHA
    e2d1707 View commit details
    Browse the repository at this point in the history