Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Company = sequelize.define({
  2.  company_graphdb_id: {...},
  3.  company_id: {..}
  4. })
  5.  
  6. var User = sequelize.define({
  7.   user_graphdb_id: {...}
  8.   user_id: {...}
  9. });
  10.  
  11. //Now when i define the relationsships
  12. Company.hasMany(User);
  13. //This gives me the ability to do
  14. companyInstance.addUser(userInstance);
  15.  
  16. //What i want to do is, in my custom addUser() do something like
  17. function myCustomAddUser(userInstance){
  18.    var userNode = graphDB.insertNode({userInstance...});
  19.    graphDB.insertrelationsShip(userNode, graphDB.getNode(company.company_graphdb_id));
  20.    return company.addUser(userInstance);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement