一、mongodb查詢
多個操作符可並列
1、滿足多個條件之一: db.find({ $or: [{ <key:value> },{ <key:value> }] })
2、查詢某個字段不存在的文檔: db.find({ key: { $exists: false } })
3、查詢某個字段爲多個值之一的文檔: db.find({ key: { $in: ['value1', 'value2', 'value3'] } }),該查詢處理空值情況很有用,
如$in:[false, undefinedm '', null]
二、mysql查詢(sequelize庫),
1、查詢某字段不重複的值:
findAll({
where: { name: 'gland' },
attributes: [[sequelize.fn('DISTINCT', sequelize.col('pen')), 'pen']]
})