node.js - one way direction, sails and mongodb -
i have question. think doing wrong.
i have 2 models: tutortype , student.
here student
module.exports = { attributes: { tutor1name:'string', tutor1type: { model: 'tutortype' }, contact: { type: 'numeric' }, } };
and here tutortype
module.exports = { attributes: { libelle: "string" } };
i use predefined blue print insert. when insert new student have returned response:
{ "name": "luke", "tutor1type": "biological", "createdat": "2015-07-13t17:57:12.526z", "updatedat": "2015-07-13t17:57:12.526z", "id": "55a3fbf8c9e93bf0266a63a8" }
should tutor1type object instead of string? actually, can put string want. able put rows have in tutortype foreign key on student.
what wrong do?!
edit
just add in db. when send id of tutortype controller. add "object(hashid)" in db. presume news.
the things can insert string not tutorlist... not understand how integrity work right here...
any ideas?!
Comments
Post a Comment