【问题标题】:"OR" query in KeystoneJS Relationship FiltersKeystoneJS 关系过滤器中的“或”查询
【发布时间】:2016-12-10 01:17:15
【问题描述】:

目前,我看到的所有例子是:

{
   team: ':team'
}

但我需要能够按多个值($或查询)进行过滤

类似:

winner: {
   type: Types.Relationship,
   ref: 'Team',
   filters: [
      {
        _id: ':homeTeam'
      },
      {
        _id: ':awayTeam'
      }
   ]
}

这可能吗?

【问题讨论】:

    标签: filter field relationship keystonejs


    【解决方案1】:

    试试下面的代码:

    filters:{_id:{$in:[id_array]}}
    

    【讨论】:

      猜你喜欢
      • 2014-10-27
      • 2017-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-30
      • 2017-10-05
      • 2015-03-26
      相关资源
      最近更新 更多