sails: .populate() where with options and IN criteria not working

Using the following query the operations don’t build the criteria correctly.

Model.find()
.populate('foo', { where: [ '1' ], skip: 0, limit: 30, sort: undefined })
.exec(/***/)

cc @mikermcneil

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 32 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Populate is not working with where condition.

Application.findOne({
      id: appId,
      status_id: {'!': Status.DELETED}
       select :['user_rating','created_at']
    })
      .populate('candidate',
        {
        status_id: {'!': Status.DELETED},
        select: [
          'first_name',
          'last_name',
          'email',
          'phone',
          'mobile',
          'town'
        ]

       .populate('job',{
         status_id: {'!': Status.DELETED},
        select : ['title']
       })

What else would be good is to have Job.find({}).populate(‘status’).sort(‘job.weight ASC’).exec(function (error, result) {

and have all the jobs sorted by the status.weight column.