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 ݽ؛੉ ੓׮Ҋ ೞݶ ׮਺җ э੉ ಴അೡ ࣻ ੓णפ

         ׮
   305   306   307   308   309   310   311   312   313   314   315