Sequelize.js: Query for not in array ($ne for items in array)

后端 未结 2 2079
悲哀的现实
悲哀的现实 2021-02-08 14:15

I am looking to pull items from a postgres data base with Sequelize, but only return items that have an id that does not equal any items in a given array.

In the Sequeli

2条回答
  •  不要未来只要你来
    2021-02-08 14:52

    using

    const Op = Sequelize.Op
    where: {
          id: {[Op.notIn]:[1, 2, 3]}
    }
    

    See operators:

    Sequelize exposes symbol operators that can be used for to create more complex comparisons

提交回复
热议问题