Skip to content

remove parseCommaParam function in populate #55

Description

@tguelcan

query = query.populate(parseCommaParam(populate));

My suggestion is to remove the parseCommaParam function because the benefit is greater to use the population function like populate({ path: 'author', select: 'name' })...

Band.
  find({}).
  populate({ path: 'members', select: 'name' }).
  exec(function(error, bands) {
    // Won't work, foreign field `band` is not selected in the projection
  });

Source https://mongoosejs.com/docs/populate.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions