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

Links are being created as type STRING and can't be populated #139

Open
gregorypierce opened this issue Oct 20, 2015 · 4 comments
Open

Links are being created as type STRING and can't be populated #139

gregorypierce opened this issue Oct 20, 2015 · 4 comments

Comments

@gregorypierce
Copy link

I've been looking into this particular structure and having issues when the hierarchy is created:

Contact
module.exports = {

attributes: {
emailAddress:
{
type: 'string',
primaryKey: true
},

  phoneNumber:
  {
      type: 'string'
  },

  faxNumber:
  {
      type: 'string'
  }

}
};

Person:

module.exports = {

attributes: {

  firstName:
  {
      type: 'string',
      required: true
  },

  middleName:
  {
      type: 'string'
  },

  lastName:
  {
      type: 'string',
      required: true
  },

  birthdate:
  {
      type: 'date'
  },

  gender:
  {
      type: 'string',
      enum: ['M', 'F']
  },

  contactPoint:
  {
      model: 'contactpoint'
  },

}
};

Now when I create a Person and look in OrientDB I'm seeing that the contactPoint is being created as type string.

In fact when I created a Person and associated a ContactPoint with it:

                ContactPoint.create( { emailAddress: _emailAddress, phoneNumber: _phoneNumber, faxNumber: _faxNumber })
                    .exec( function contactPointCreated( cErr, createdContactPoint )
                    {
                        if ( !cErr )
                        {
                            console.log( "Contact", createdContactPoint );

                            createdPerson.contactPoint = createdContactPoint.id;
                            createdPerson.save();

                        }
                        else {
                            console.log("Unable to create contact point", cErr );
                        }

                    });

I can go into the database and see that the type of contactPoint for the person is a string. Its holding the @Rid, but when I perform a populate on that value I don't get anything for the populated contactPoint attribute.

This is with [email protected], [email protected], and OrientDB 2.1.2.

@dmarcelino
Copy link
Member

Hi @gregorypierce, have you tried with OrientDB v2.0? Currently v2.1 is not supported, check #52.

@gregorypierce
Copy link
Author

Got it. Will revert back to 2.0.15 and see if the behavior persists.

On Sat, Oct 24, 2015 at 7:26 AM, Dário [email protected] wrote:

Hi @gregorypierce https://github.com/gregorypierce, have you tried with
OrientDB v2.0? Currently v2.1 is not supported, check #52
#52.


Reply to this email directly or view it on GitHub
#139 (comment)
.

@gregorypierce
Copy link
Author

Reverted to 2.0.15 and still encountered the same issue. Still seeing the
LINK being represented as a STRING and the populate is coming back empty.

On Mon, Oct 26, 2015 at 4:22 PM, Gregory Pierce [email protected]
wrote:

Got it. Will revert back to 2.0.15 and see if the behavior persists.

On Sat, Oct 24, 2015 at 7:26 AM, Dário [email protected] wrote:

Hi @gregorypierce https://github.com/gregorypierce, have you tried
with OrientDB v2.0? Currently v2.1 is not supported, check #52
#52.


Reply to this email directly or view it on GitHub
#139 (comment)
.

@dmarcelino
Copy link
Member

That's unfortunate to hear. Do you mind create an automated test (check 116-test_edge_creation.js for an example)?

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

No branches or pull requests

2 participants