Sailsjs Mysql ORM multiple query on the same table field

前端 未结 2 1012
予麋鹿
予麋鹿 2021-01-23 17:48

Im using sails v 0.10.5 and latest sails-mysql

I have a Restaurant filtering system

Venue.find().populate(\'comments\', {
        deleted: false
    }).w         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-23 18:38

    Venue.find().populate('comments', {
        deleted: false
    }).where({
            restaurant_services: {
                contains: '"delivery":1',
                contains: '"takeout":1',
            },
            restaurant_specialties: {contains: '"breakfast":1'}
    })
    

    that you need

    Venue.find({
      where:{
        restaurant_services: {
          contains: '"delivery":1',
          contains: '"takeout":1',
        },
        restaurant_specialties: {
          contains: '"breakfast":"1"'
        }
      }
    }).populate('comments', {
        deleted: false
    }).exec(console.log);
    

提交回复
热议问题