簡體   English   中英

如何在帶有node.js的打字稿續集中使用'or'選項?

[英]How to use 'or' option in typescript-sequelize with node.js?

我用打字稿續集

如何使用findOne({where: {something or something2}}); 我讀了文檔,我聽不懂幫我

首先,您必須導入Op

import {Op} from "sequelize";

然后創建如下的where子句:

findOne({where: {
  value_to_find: {
    [Op.or]: {
      [Op.eq]: something,
      [Op.eq]: something2
    }
  }
}})

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM