Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can #ref appear with extra properties? #156

Closed
nurkkala opened this issue Jun 29, 2016 · 3 comments
Closed

Can #ref appear with extra properties? #156

nurkkala opened this issue Jun 29, 2016 · 3 comments
Labels

Comments

@nurkkala
Copy link

nurkkala commented Jun 29, 2016

Objection is wonderful -- thanks so much!

One quick question: when using #ref with insertWithRelated, can the object enclosing the #ref have extra properties (to be inserted into a through table)?

@nurkkala nurkkala changed the title Can #ref appear with any other properties? Can #ref appear with extra properties? Jun 29, 2016
@elhigu
Copy link
Contributor

elhigu commented Jul 1, 2016

Do you mean like in example from documents:

Person
  .query()
  .insertWithRelated([{
    firstName: 'Jennifer',
    lastName: 'Lawrence',

    movies: [{
      "#id": 'Silver Linings Playbook'
      name: 'Silver Linings Playbook',
      duration: 122
    }]
  }, {
    firstName: 'Bradley',
    lastName: 'Cooper',

    movies: [{
      "#ref": 'Silver Linings Playbook'
    }]
  }]);

But with having for example:

    movies: [{
      "#ref": 'Silver Linings Playbook',
      "count": 5
    }]

where count would be written in join table?

I have no idea if that works, @koskimas should have better idea of it. Sounds interesting idea 👍 And Sami is on vacations right now, so it might take a while before he notices this :)

@elhigu elhigu added the question label Jul 1, 2016
@koskimas
Copy link
Collaborator

koskimas commented Jul 6, 2016

I don't know 😁 Have you tried it? Sounds like something that should work.

@fl0w
Copy link
Contributor

fl0w commented Jul 6, 2016

Wasn't this added when the addition of extra was added to relationMappings? I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants