Page 310 - Nodejs 교과서 개정2판
P. 310
ҙ҅ীࢲח hasMany ݫࢲ٘ न hasOne ݫࢲ٘ܳ ࢎਊפ ࢎਊ ࠁܳ Ҋ ח о࢚ *OGP ݽ؛
Ҋ ೞݶ җ э അೡ ࣻ णפ
db.User.hasOne(db.Info, { foreignKey: 'UserId', sourceKey: 'id' });
db.Info.belongsTo(db.User, { foreignKey: 'UserId', targetKey: 'id' });
ҙ҅ۄҊ ೧ب belongsTo৬ hasOne ߈ݶ উ ؾפ belongsToܳ ࢎਊೞח *OGP ݽ؛ী UserId ஸۢ
୶оغӝ ٸޙੑפ
§ Ӓܿ ҙ҅
/ .
ইө ࢸݺ೮؍ ѱदӖҗ ೧दకӒ ݽ؛ р / . ҙ҅ܳ Ӓܿਵ۽ അ೧ࠌणפ
§ Ӓܿ / . ҙ҅
द௬ۄૉীח / . ҙ҅ܳ അೞӝ ਤೠ belongsToMany ݫࢲ٘о णפ ѱदӖ ࠁܳ Ҋ ח о࢚
1PTU ݽ؛җ ೧दకӒ ࠁܳ Ҋ ח о࢚ )BTIUBH ݽ؛ Ҋ ೞݶ җ э അೡ ࣻ णפ