Skip to content

Many to many: How to access relation properties? #466

Closed

Description

@pfirpfel

Hello there!

From: https://github.com/dresende/node-orm2#hasmany

Patient.hasMany('doctors', Doctor, { why: String }, { reverse: 'patients' });
Patient.sync();

[...]

patient.addDoctor(surgeon, {why: "remove appendix"}, function(err) {} )

How could I access the 'why'-property in this case? I can't seem to find it in the documentation.

Thanks for your help!

Activity

  1. dxg commented on Mar 13, 2014

    @dxg
    Collaborator

    Is this what you're looking for?

  2. pfirpfel commented on Mar 13, 2014

    @pfirpfel
    Author

    Yes, it was. But it seems, that 'extras' with the type Object won't work. Only if I manually stringify/parse the object, I was able to save and retrieve it.

  3. added this to the v2.1.4 milestone on Mar 13, 2014
  4. dxg commented on Mar 13, 2014

    @dxg
    Collaborator

    The conversion code was missing from has many. It's fixed now on master.
    New orm version will be out soon.

  5. pfirpfel commented on Mar 13, 2014

    @pfirpfel
    Author

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions