我开始学习 SequelizeJs 但是我遇到了一个小问题:我有一个这样定义的模型:
var ex_table= sequelize.define("ex_table", {
concept1: Sequelize.STRING(5),
concept2: Sequelize.STRING(80),
concept3: Sequelize.STRING,
weight: Sequelize.INTEGER,
value: Sequelize.DECIMAL(20,2)
}, {
tableName: "samble_table"});
从表中检索单行有效,我这样做:
ex_table
.find({where: Sequelize.and({weight: 320193}, {concept1: 'AGLOK'}, {concept2: 'lambda'}, {concept2: 'Industry Group'})})
.complete(function (err, result) {
if (!!err) {
console.log("An error occurred while creating the table:", err);
} else {
console.log(result.values);
}
})
这给了我一行数据,这是预期的。但是,当我尝试像这样检索多行时:
ex_table
.findAll({where: Sequelize.and({weight: 320193}, {concept1: 'AGLOK'}, {concept2: 'lambda'}, {concept2: 'Industry Group'})})
.complete(function (err, result) {
if (!!err) {
console.log("An error occurred while creating the table:", err);
} else {
console.log(result.values);
}
})
在这里我被低估了,任何想法如何获得多行?