Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Company = sequelize.define({
- company_graphdb_id: {...},
- company_id: {..}
- })
- var User = sequelize.define({
- user_graphdb_id: {...}
- user_id: {...}
- });
- //Now when i define the relationsships
- Company.hasMany(User);
- //This gives me the ability to do
- companyInstance.addUser(userInstance);
- //What i want to do is, in my custom addUser() do something like
- function myCustomAddUser(userInstance){
- var userNode = graphDB.insertNode({userInstance...});
- graphDB.insertrelationsShip(userNode, graphDB.getNode(company.company_graphdb_id));
- return company.addUser(userInstance);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement