Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

sequelize之莫名其妙的ID

$
0
0

include

include: [{
            model: Casinos, required: true,
            attributes: [],
            include: [{
              model: Countries,
              attributes: [sequelize.literal('`casino.country`.`name` AS `country`')],
            }, {
              model: Cities,
              attributes: [sequelize.literal('`casino.city`.`name` AS `city`')]
            }]
}]

结果

{
    "casino.country.id": 1,
    "country": "中国1",
    "casino.city.id": 1,
    "city": "北京1"
}

这俩个id为什么会出来呢,我明明没有定义啊!


Viewing all articles
Browse latest Browse all 14821

Trending Articles